forked from LoeiFy/Diaspora
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsingle.php
90 lines (67 loc) · 2.66 KB
/
single.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<?php require_once('config.php'); ?>
<?php get_header(); ?>
<div id="single">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php setPostViews(get_the_ID()); ?>
<?php $args = array(
'post_type' => 'attachment',
'numberposts' => -1,
'orderby' => 'menu_order',
'order' => 'ASC',
'post_mime_type' => 'image',
'post_status' => null,
'post_parent' => $post->ID
); ?>
<div id="top">
<div class="bar"></div>
<a class="<?php if (LOGO_FONT) { echo 'icon-icon'; } else { echo 'image-icon'; } ?>" href="javascript:history.back()"></a>
<div title="播放/暂停" data-id="<?php the_ID() ?>" class="icon-play"></div>
<div title="查看壁纸" class="icon-images"></div>
<h3 class="subtitle"><?php the_title(); ?></h3>
<div class="social">
<div class="like-icon">
<?php tz_printLikes(get_the_ID()); ?>
</div><!--
--><div>
<?php get_template_part( 'social' ); ?>
</div>
</div>
<div class="scrollbar"></div>
</div>
<div class="section">
<div class="images">
<div id="jg">
<?php $attachments = get_posts($args); if ($attachments) { ?>
<?php foreach ( $attachments as $attachment ) { $img = wp_get_attachment_image_src($attachment->ID,'thumbnail'); ?>
<a class="zoom icon-zoom" target="_blank" href="<?php echo wp_get_attachment_url( $attachment->ID , false ); ?>"><img width="300" height="<?php echo $img[2] ?>" src="<?php echo $img[0] ?>"/></a>
<?php } ?>
<?php } ?>
</div>
<a target="_blank" class="downloadlink">壁纸下载</a>
</div><div class="article">
<div>
<h1 class="title"><?php the_title(); ?></h1>
<div class="stuff">
<span><?php the_time('F j, Y'); ?> </span>
<span>阅读 <?php echo getPostViews(get_the_ID()); ?></span>
<span>字数 <?php echo count_words ($text); ?></span>
<span>评论 <?php comments_number( '0', '1', '%' ); ?></span>
<span>喜欢 <?php tz_printLikes(get_the_ID()); ?></span>
</div>
<div class="content">
<?php the_content(); ?>
</div>
<?php if (!DEFAULT_COMMENT) { ?>
<div class="comment link" data-id="<?php the_ID(); ?>">添加评论</div>
<?php } ?>
<!-- 自带评论请自行添加样式相关,已经无力弄这个 -->
<?php if (DEFAULT_COMMENT) { comments_template(); } ?>
</div>
</div>
</div>
<div class="relate">
<?php get_template_part( 'related' ); ?>
</div>
<?php endwhile; endif; ?>
</div>
<?php get_footer(); ?>