-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathsingle.php
133 lines (117 loc) · 5.76 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<?php
// 获取头部文件
get_header();
// 获取配置 # 头部
$meta_date_on = QGG_Options('post_meta_date_on') ?: false;
$meta_author_on = QGG_Options('post_meta_author_on') ?: false;
$meta_author_link = QGG_Options('post_meta_author_link_on') ?: '#';
$meta_view_on = QGG_Options('post_meta_view_on') ?: false;
$meta_like_on = QGG_Options('post_meta_like_on') ?: false;
$meta_comment_on = QGG_Options('post_meta_comment_on') ?: false;
// 获取配置 # 模块
$ads_txt_on = QGG_Options('ads_post_footer_text_on') ?: false;
$ads_txt_title = QGG_Options('ads_post_footer_text_title') ?: '子不语';
$ads_txt_desc = QGG_Options('ads_post_footer_text_desc') ?: '一个不学无术的伪程序员';
$ads_txt_blank = QGG_Options('ads_post_footer_text_blank') ?: false;
$ads_txt_link = QGG_Options('ads_post_footer_text_link') ?: 'https://zibuyu.life/';
$related_on = QGG_Options('posts_related_on') ?: false;
$related_title = QGG_Options('posts_related_title') ?: '相关文章';
$related_num = QGG_Options('posts_related_num') ?: 8;
$related_thumb_on = QGG_Options('posts_related_thumb_on') ?: false;
?>
<section class="container">
<div class="content-wrapper">
<!-- 内容 -->
<div class="content site-style-border-radius">
<?php while (have_posts()) : the_post(); ?>
<!-- 文章头部Meta -->
<header class="post-header">
<h1 class="title">
<?php the_title(); ?><?php echo _get_the_post_subtitle() ?>
</h1>
<div class="meta site-style-childA-hover-color">
<!-- 分类 -->
<span class="category">分类:<?php the_category('/')?></span>
<?php
// 日期
if( $meta_date_on ){
echo '<span class="time"><i class="fal fa-clock"></i> '.get_the_time('m-d').'</span>';
}
// 作者
if( $meta_author_on ){
$author = get_the_author();
if( $meta_author_link ){
$author = '<a href="'.get_author_posts_url( get_the_author_meta( 'ID' ) ).'"><i class="fal fa-user"></i> '.$author.'</a>';
} else {
$author = '<i class="fal fa-user"></i> '.$author;
}
echo '<span class="author"> '.$author.'</span>';
}
// 阅读
if( $meta_view_on ){
echo '<span class="reader"><i class="fal fa-eye"></i> 阅读('._get_the_post_views().')</span>';
}
// 喜欢
if( $meta_like_on ){
echo'<span class="like"><i class="fal fa-heart"></i>喜欢 ('._get_the_post_likes().')</span>';
}
// 评论
if ( $meta_comment_on && comments_open() ) {
echo '<span class="comt"><a class="pc" href="'.get_comments_link().'"><i class="fal fa-comment"></i> 评论('.get_comments_number('0', '1', '%').')</a></span>';
}
?>
<!-- 编辑 -->
<span class="edit"><?php edit_post_link('[编辑]'); ?></span>
</div>
</header>
<!-- 广告代码 -->
<?php _ads_loader($adsname='ads_post_default', $classname='module ads-post-default'); ?>
<!-- 文章内容 -->
<article class="post-content">
<?php the_content(); ?>
</article>
<!-- 历史文章 -->
<?php _module_loader('module_posts_today_in_history'); ?>
<!-- 分页按钮 -->
<?php wp_link_pages( array( // 无法设置激活的样式
'before' => '<div class="module link-pages-wrapper">',
'after' => '</div>',
'link_before' => '<span>',
'link_after' => '</span>',
'next_or_number' => 'number',
'pagelink' => '%',
) );
?>
<!-- 文字广告 -->
<?php if ($ads_txt_on) {
echo '
<div class="module ads-post-footer-text site-style-childA-hover-color">
<b>AD:</b><strong>【'.$ads_txt_title.'】</strong>
<a'.( $ads_txt_blank ? ' target="_blank"':'' ).' href="'.$ads_txt_link.'">'.$ads_txt_desc.'</a>
</div>';
} ?>
<!-- 作者信息 -->
<?php _module_loader('module_post_author_panel'); ?>
<!-- 版权信息 -->
<?php _module_loader('module_post_copyright'); ?>
<?php endwhile; ?>
<!-- 翻页导航 -->
<?php _module_loader('module_post_nav_prevnext'); ?>
<!-- 文章底部分享点赞打赏 -->
<?php _module_loader('module_post_share_like_reward'); ?>
<!-- 文章底部相关文章 -->
<?php
if( $related_on ){
_module_loader('module_posts_related', false);
module_posts_related( $related_title, $related_num, $related_thumb_on );
}
?>
<!-- 文章底部读者评论 -->
<?php comments_template('', true); ?>
</div>
</div>
<!-- 侧栏 -->
<?php get_sidebar(); ?>
</div>
</section>
<?php get_footer();