forked from weipxiu/Art_Blog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
single.php
266 lines (253 loc) · 14.2 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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="Author" content='<?php echo the_author(); ?>' />
<meta name="description" content="<?php echo mb_strimwidth(strip_tags(apply_filters('the_content', $post->post_content)), 0, 200,"
... "); ?>" />
<?php
$keywords = get_post_meta($post->ID, "keywords", true);
if($keywords == '') {
$tags = wp_get_post_tags($post->ID);
foreach ($tags as $tag ) {
$keywords = $keywords . $tag->name . ", ";
}
$keywords = rtrim($keywords, ', ');
}
?>
<meta name="keywords" content="<?php echo $keywords; ?>" />
<meta name="format-detection" content="telephone=no" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, user-scalable=no">
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests"><!--强制https-->
<title>
<?php the_title(); ?> | 关注WEB前端开发技术 - 唯品秀博客</title>
<link rel="shortcut icon" type="image/x-icon" href="<?php bloginfo('template_url'); ?>/favicon.ico" />
<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/font-awesome-4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" media="screen and (max-width:767px)" href="<?php bloginfo('template_url'); ?>/css/style-ios.css">
<link rel="stylesheet" type="text/css" media="screen and (min-width:768px) and (max-width:1199px)" href="<?php bloginfo('template_url'); ?>/css/style-ipd.css">
<link rel="stylesheet" type="text/css" media="screen and (min-width:1200px)" href="<?php bloginfo('template_url'); ?>/style.css">
<style>
body {
-moz-user-select: text;
-webkit-user-select: text;
-ms-user-select: text;
user-select: text;
background: #f1f1ef;
}
.continar-left {
border-radius: 5px;
background: #fff;
padding: 15px;
border: 1px solid #e6e6e6;
}
/* #SOHUCS #SOHU_MAIN .module-cmt-notice {
display: none;
} */
@media screen and (min-width:980px) {
.continar-left {
margin-top: 50px;
}
}
</style>
</head>
<body>
<!--头部文件引用开始-->
<?php get_header();?>
<!--头部文件引用结束-->
<!-- 正文区域start -->
<div class="continar">
<?php
if (have_posts()) : while (have_posts()) : the_post();setPostViews(get_the_ID());
?>
<div class="continar-left">
<!-- 面包屑导航 -->
<div class="mod-crumbs">
<span class="mod-breadcrumb">
<?php wheatv_breadcrumbs(); ?>
</span>
</div>
<div class="xiaob">
<h2 class="title">
<?php the_title(); ?>
</h2>
<p class="data-l">
<span><i class="iconfont icon-shijian1"></i> <?php the_time('Y年m月d日') ?></span>
<span>作者:
<?php the_author(); ?>
</span>
<span>
<i class="iconfont icon-liulan"></i>
<?php echo getPostViews(get_the_ID()); ?>次浏览</span>
<span>
<a href="<?php the_permalink(); ?> ">
<i class="iconfont icon-pinglun2"></i>
<span id="url::<?php the_permalink(); ?>" class="cy_cmt_count"></span>
<script id="cy_cmt_num" src="https://changyan.sohu.com/upload/plugins/plugins.list.count.js?clientId=cyt2b1NqT">
</script>
条评论
</a>
</span>
</p>
</div>
<div class="log-text">
<?php the_content(); ?>
<!--文章内容-->
<?php endwhile; else : ?>
<h2>
<?php _e('Not Found'); ?>
</h2>
<?php endif; ?>
<p class="copy">「两年博客,如果觉得我的文章对您有用,请帮助本站成长」</p>
<!--文章打赏开始-->
<!-- PC端start -->
<div class="post-actions">
<span class="post-like action action-like">
<a href="javascript:;" data-action="ding" data-id="<?php the_ID(); ?>" class="favorite<?php if(isset($_COOKIE['bigfa_ding_'.$post->ID])) echo ' done';?>">
<i class="fa fa-thumbs-o-up"></i>赞(
<span class="count">
<?php if( get_post_meta($post->ID,'bigfa_ding',true) ){
echo get_post_meta($post->ID,'bigfa_ding',true);
} else {
echo '0';
}?>
</span>)
</a>
</span>
<a href="javascript:;" class="action action-rewards" data-event="rewards">
<i class="fa fa-jpy"></i> 打赏
<span class="tooltip-content">
<span class="tooltip-text">
<span class="tooltip-inner">
<p class="reward-p">
<i class="icon icon-quo-left"></i>谢谢你请我吃鸡腿*^_^*
<i class="icon icon-quo-right"></i>
</p>
<div class="reward-box">
<div class="reward-box-item">
<img class="reward-img" src="<?php bloginfo('template_url'); ?>/images/alipay.png">
<span class="reward-type">支付宝</span>
</div>
<div class="reward-box-item">
<img class="reward-img" src="<?php bloginfo('template_url'); ?>/images/weixin.png">
<span class="reward-type">微信</span>
</div>
</div>
</span>
</span>
</span>
</a>
</div>
<!-- PC端end -->
<div class="page-reward">
<div class="page-reward-btn tooltip-top">
<div class="tooltip tooltip-east">
<span class="tooltip-item">
<font class="s_show">赏</font>
<a href="javascript:;" style="color: #f78585" data-action="ding" data-id="<?php the_ID(); ?>" class="favorite<?php if(isset($_COOKIE['bigfa_ding_'.$post->ID])) echo ' done';?>">
<i class="fa fa-thumbs-o-up" style="color: #fff"></i>
<span class="tog_show">
<?php if( get_post_meta($post->ID,'bigfa_ding',true) ){
echo get_post_meta($post->ID,'bigfa_ding',true);
} else {
echo '0';
}?>
</span>
</a>
</span>
<span class="tooltip-content">
<span class="tooltip-text">
<span class="tooltip-inner">
<p class="reward-p">
<i class="icon icon-quo-left"></i>谢谢你请我吃鸡腿*^_^*
<i class="icon icon-quo-right"></i>
</p>
<div class="reward-box">
<div class="reward-box-item">
<img class="reward-img" src="<?php bloginfo('template_url'); ?>/images/alipay.png">
<span class="reward-type">支付宝</span>
</div>
<div class="reward-box-item">
<img class="reward-img" src="<?php bloginfo('template_url'); ?>/images/weixin.png">
<span class="reward-type">微信</span>
</div>
</div>
</span>
</span>
</span>
</div>
</div>
</div>
</div>
<!--文章打赏结束-->
<div class="key-w">
<div class="single_lable">
<i class="iconfont" style="padding-right:3px"></i>标签:</div>
<?php the_tags('','',''); ?>
</div>
<p class="text-post text-post-top">
<?php if (get_previous_post()) { previous_post_link('<span>上一篇:</span>%link');} else {echo "没有了,已经是最后文章";} ?>
</p>
<p class="text-post">
<?php if (get_next_post()) { next_post_link('<span>下一篇:</span>%link');} else {echo "下一篇:没有了,已经是最新文章";} ?>
</p>
<!-- 畅言公共JS代码 start (一个网页只需插入一次) -->
<div id="SOHUCS"></div>
<script type="text/javascript">
(function () {
var appid = 'cyt2b1NqT';
var conf = '82271e371d1386ecc2659e2cff9c706c';
var width = window.innerWidth || document.documentElement.clientWidth;
if (width < 960) {
window.document.write(
'<script id="changyan_mobile_js" charset="utf-8" type="text/javascript" src="https://changyan.sohu.com/upload/mobile/wap-js/changyan_mobile.js?client_id=' +
appid + '&conf=' + conf + '"><\/script>');
} else {
var loadJs = function (d, a) {
var c = document.getElementsByTagName("head")[0] || document.head ||
document.documentElement;
var b = document.createElement("script");
b.setAttribute("type", "text/javascript");
b.setAttribute("charset", "UTF-8");
b.setAttribute("src", d);
if (typeof a === "function") {
if (window.attachEvent) {
b.onreadystatechange = function () {
var e = b.readyState;
if (e === "loaded" || e === "complete") {
b.onreadystatechange = null;
a()
}
}
} else {
b.onload = a
}
}
c.appendChild(b)
};
loadJs("https://changyan.sohu.com/upload/changyan.js", function () {
window.changyan.api.config({
appid: appid,
conf: conf
})
});
}
})();
</script>
<!-- 畅言公共JS代码 end -->
</div>
<!-- 左侧区域结束 -->
<!-- 右侧区域开始 -->
<div class="continar-right">
<?php get_sidebar( $name ); ?>
</div>
<!-- 右侧区域结束 -->
</div>
<!-- 正文区域end -->
<!-- 底部引用区域开始 -->
<?php get_footer()?>
<!-- 底部引用区域结束 -->
</body>
<script>
$("html").css("overflow", "visible");
</script>
</html>