This repository has been archived by the owner on Sep 12, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
single.php
99 lines (97 loc) · 5.61 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
91
92
93
94
95
96
97
98
99
<?php get_header(); ?>
<div class="container">
<div class="section-head">
<span>Single</span></div>
</div>
<div class="boxmoe-blog-page mb30">
<div class="container">
<div class="row">
<div class="col-md-12 col-lg-12 ml-auto mr-auto">
<?php while (have_posts()) : the_post(); ?>
<div class="post-single">
<h3 class="post-title <?php boxmoe_wow_set( )?>"><?php the_title(); echo get_the_subtitle(); ?></h3>
<div class="post-meta">
<div class="post-auther-avatar">
<?php echo get_avatar(get_the_author_meta( 'user_email' ),60, '', '',array( 'class'=>array('img-fluid'))); ?></div>
<div class="post-meta-info">
<span class="post-date">
<i class="fa fa-clock-o"></i>Post on <?php echo get_the_time( 'Y-m-d'); ?></span>
<span class="post-view">
<i class="fa fa-street-view"></i><?php setPostViews(get_the_ID()); ?><?php echo getPostViews(get_the_ID()); ?></span>
<span class="post-comment">
<i class="fa fa-comments-o"></i><?php echo get_comments_number( '0', '1', '%') ?></span>
<span class="category-meta">
<?php $category = get_the_category();if($category[0]){ echo '
<a href="'.get_category_link($category[0]->term_id ).'" title="查看《'.$category[0]->cat_name.'》下的所有文章 " rel="category tag" '. _post_target_blank().'>
<i class="fa fa-folder-o"></i>'.$category[0]->cat_name.'</a>'; };?>
</span><?php edit_post_link( '['.__( '<span>编辑仅作者可见</span>', 'meowdata'). ']'); ?>
</div>
</div>
<div class="post-content">
<?php the_content(); ?>
</div>
<?php wp_link_pages(array('before' => '<div class="fenye pagination justify-content-center">', 'after' => '</div>', 'next_or_number' => 'number',
'link_before' =>'<span>', 'link_after'=>'</span>')); ?>
<div class="post-footer">
<div class="post-tags">
<div class="article-categories">
<?php the_tags( '', '', ''); ?></div>
</div>
</div>
</div>
<?php if (get_boxmoe('open_author_info')){?>
<div class="block_auther_post mt10">
<div class="row">
<div class="col-lg-7">
<div class="media">
<?php echo get_avatar( get_the_author_meta( 'user_email' ), 80, '', '',array( 'class'=>array('img_person'))); ?>
<div class="media-body">
<div class="txt">
<h4><?php the_author(); ?></h4>
<p><?php echo get_boxmoe( 'authorinfo'); ?></p>
</div>
</div>
</div>
</div>
<div class="col-lg-4 my-auto ml-auto text-lg-right"><?php if(get_boxmoe('boxmoe_qq')){?>
<a href="https://wpa.qq.com/msgrd?v=3&uin=<?php echo get_boxmoe('social_qq');?>&site=qq&menu=yes" target="_blank" class="btn-social color-qq border-0 mr-2">
<i class="fa fa-qq"></i>
</a><?php } ?><?php if(get_boxmoe('boxmoe_wechat')){?>
<a href="#modal-weixin " data-toggle="modal" data-target="#modal-weixin" class="btn-social color-weixin border-0 mr-2">
<i class="fa fa-weixin"></i>
</a><?php } ?><?php if(get_boxmoe('boxmoe_github')){?>
<a href="<?php echo get_boxmoe('social_github');?>" target="_blank" class="btn-social color-github border-0 mr-2">
<i class="fa fa-github"></i>
</a><?php } ?>
</div>
</div>
</div>
<?php }?>
<?php $categories=get_the_category();$categoryIDS=array();foreach ($categories as $category) { array_push($categoryIDS, $category->term_id);}$categoryIDS = implode(",", $categoryIDS);?>
<nav class="post-navigation thw-sept">
<div class="row no-gutters">
<div class="col-12 col-md-6">
<div class="post-previous">
<?php if (get_next_post($categoryIDS)) { next_post_link('%link','<span><i class="fa fa-angle-left"></i> Previous Post</span><h4>%title</h4>',true);} else { echo '<span><i class="fa fa-angle-left"></i> Previous Post </span><h4>本文分类下已经是最后一篇文章了哦!';} ?>
</div>
</div>
<div class="col-12 col-md-6">
<div class="post-next">
<?php if (get_previous_post($categoryIDS)) { previous_post_link( '%link', '<span>Next Post <i class="fa fa-angle-right"></i></span> <h4>%title</h4>',true);}else { echo '<span>Next Post <i class="fa fa-angle-right"></i></span> <h4>本文分类下已经是最新一篇文章了哦!</h4>';} ?>
</div>
</div>
</div>
</nav>
<?php endwhile; ?>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-lg-12 col-md-12 ml-auto mr-auto">
<?php if (get_boxmoe('comments_off')==''):?><?php comments_template( '', true); ?><?php endif; ?>
</div>
</div>
</div>
</div>
<?php get_footer(); ?>