-
-
Notifications
You must be signed in to change notification settings - Fork 65
/
archive.php
145 lines (130 loc) · 8.31 KB
/
archive.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
<?php get_header(); ?>
<?php
$category = get_the_category();
if ($category[0]) $id = $category[0]->term_id;
$name = $category[0]->cat_name;
$des = $category[0]->description;
if (empty($des)) $des = '无描述的分类';
if (!get_option('king_fre_cate')) $f = '99999';
else $f = get_option('king_fre_cate');
if (!get_option('king_wor_cate')) $w = '66666';
else $w = get_option('king_wor_cate');
if (!get_option('king_per_page')) $p = '6';
else $p = get_option('king_per_page');
if (get_option('king_display_author') == '关闭') $a = false;
else $a = true;
?>
<div id="header_info">
<nav class="header-nav reveal">
<a class="top1 header-logo" style="text-decoration:none;" href="<?php echo site_url() ?>">XXXXX</a>
<p class="top2 lead archive-p">XXXXXXXXXXXXXXXXXXXXXXXXXXX</p>
<div class="btn-group" style="float: right;margin-top: -65px;">
<button type="button" class="btn btn-primary"><a href="<?php echo site_url() ?>" style="text-decoration:none;color:white"><i class="czs-hand-slide" style="margin-right:5px"></i>回到首页</a></button>
</div>
</nav>
<div class="index-cates">
<?php
if (get_option('king_nav_display_top')) {
$array_menu = wp_get_nav_menu_items(get_option('king_nav_display_top'));
$menu = array();
foreach ($array_menu as $m) {
if (empty($m->menu_item_parent)) {
?>
<li class="cat-item cat-item-4 cat-real"> <a href="<?php echo $m->url ?>"><?php echo $m->title ?></a>
</li>
<?php }
}
} else { ?>
<li class="cat-item cat-item-4 cat-real" style="display:none" v-for="de in des" v-if="de.count !== 0"> <a :href="de.link" :title="de.description" v-html="de.name"></a>
</li>
<li class="cat-item cat-item-4 loading-line" style="display: inline-block;width: 98%;height: 35px;box-shadow: none;border-radius: 0px;background: rgb(236, 237, 239);" v-if="loading_des"></li>
<?php } ?>
</div>
</div>
<ul class="article-list" style="opacity:0">
<li v-if="loading" class="article-list-item reveal index-post-list uk-scrollspy-inview loading-line"><em class="article-list-type1" style="padding: 5.5px 45px;"> </em> <a style="text-decoration: none;">
<h5 style="background: rgb(236, 237, 238);"> </h5>
</a>
<p style="background: rgb(246, 247, 248);width: 90%;"> </p>
<p style="background: rgb(246, 247, 248);width: 60%;"> </p>
</li>
<!-- 占位DIV -->
<li :class="'article-list-item reveal index-post-list ' + (post.sticky ? 'sticky-one' : '')" v-for="post in posts" :style="post.post_categories[0].term_id | link_style">
<template v-if="post.post_img.url == false || post.post_categories[0].term_id == <?php echo $f; ?> || post.post_categories[0].term_id == <?php echo $w; ?>">
<em v-if="post.post_categories[0].term_id == <?php tony_func('echo_s_cate'); ?>" class="article-list-type1">{{ post.post_categories[0].name + ' | ' + (post.post_metas.tag_name ? post.post_metas.tag_name.toUpperCase() : '<?php tony_func('echo_ph_cate'); ?>') }}</em>
<div v-if="post.post_categories[0].term_id == <?php echo $f; ?> || post.post_categories[0].term_id == <?php echo $w; ?>" class="link-list-left"><img :src="post.post_metas.img[0]" class="link-list-img"></div>
<div class="link-list-right" :style="(post.post_categories[0].term_id == <?php echo $f; ?> || post.post_categories[0].term_id == <?php echo $w; ?> || post.post_categories[0].term_id == <?php tony_func('echo_s_cate'); ?>) ? '' : 'margin-top: -10px;'">
<a v-if="post.post_categories[0].term_id == <?php echo $f; ?> || post.post_categories[0].term_id == <?php echo $w; ?>" :href="post.post_metas.link" style="text-decoration: none;" target="_blank">
<h5 style="margin-top: 10px;" v-html="post.title.rendered"></h5>
</a>
<a v-else :href="post.link" style="text-decoration: none;">
<h5 v-html="post.title.rendered"></h5>
</a>
<p v-html="post.post_excerpt.nine"></p>
<div class="article-list-footer">
<?php if($a){ ?>
<span class="article-list-date display-author" v-html="post.post_metas.author"></span>
<span class="article-list-divider">-</span>
<?php } ?>
<span class="article-list-date">{{ post.post_categories[0].term_id | link_page }}{{ post.post_date }}</span>
<span class="article-list-divider" v-if="post.post_categories[0].term_id !== <?php echo $f; ?> && post.post_categories[0].term_id !== <?php echo $w; ?>">-</span>
<span class="article-list-minutes" v-if="post.post_categories[0].term_id !== <?php echo $f; ?> && post.post_categories[0].term_id !== <?php echo $w; ?>">{{ post.post_metas.views }} Views</span>
</div>
</div>
</template>
<template v-else>
<div class="article-list-img-else">
<div class="article-list-img" :style="'background-image:url(' + post.post_img.url +')'"></div>
<div class="article-list-img-right">
<!-- 置顶文章提示 -->
<em class="article-list-type1 sticky-one-tag" v-if="post.sticky"><i class="czs-arrow-up-l" style="font-size: 14px;font-weight: 600;"></i> 置顶</em>
<!-- 置顶文章提示 -->
<em v-if="post.post_categories[0].term_id === <?php tony_func('echo_s_cate'); ?>" class="article-list-type1">{{ post.post_categories[0].name + ' | ' + (post.post_metas.tag_name ? post.post_metas.tag_name.toUpperCase() : '<?php tony_func('echo_ph_cate'); ?>') }}</em>
<a :href="post.link" style="text-decoration: none;">
<h5 v-html="post.title.rendered" style="margin: 0px;padding: 0px;margin-top:15px"></h5>
</a>
<p v-html="post.post_excerpt.four" :id="post.id"></p>
<div class="article-list-footer">
<?php if($a){ ?>
<span class="article-list-date display-author" v-html="post.post_metas.author"></span>
<span class="article-list-divider">-</span>
<?php } ?>
<span class="article-list-date">{{ post.post_date }}</span>
<span class="article-list-divider">-</span>
<span v-if="post.post_metas.views !== ''" class="article-list-minutes">{{ post.post_metas.views }} Views</span>
<span v-else class="article-list-minutes">0 Views</span>
</div>
</div>
</div>
</template>
</li>
<li :class="'article-list-item reveal index-post-list uk-scrollspy-inview bottom '+loading_css"><em class="article-list-type1" style="padding: 5.5px 45px;"> </em> <a style="text-decoration: none;">
<h5 style="background: rgb(236, 237, 238);"> </h5>
</a>
<p style="background: rgb(246, 247, 248);width: 90%;"> </p>
<p style="background: rgb(246, 247, 248);width: 60%;"> </p>
</li>
<!-- 加载占位DIV -->
<!-- 加载按钮 -->
<button @click="new_page" id="scoll_new_list" style="opacity:0"></button>
<!-- 加载按钮 -->
</ul>
<script>
window.cate_id = <?php echo $id; ?>;
window.site_url = '<?php echo site_url() ?>';
window.cate_name = '<?php echo $name; ?>';
window.cate_des = '<?php echo $des; ?>';
window.cate_exclude_option = '<?php if (get_option('king_index_cate_exclude')) echo get_option('king_index_cate_exclude'); ?>';
<?php if (get_option('king_index_cate_exclude')) { ?>
window.cate_exclude = 'true';
<?php } else { ?>
window.cate_exclude = 'false';
<?php } ?>
window.index_p = <?php echo $p; ?>;
window.cate_fre = <?php if (get_option('king_fre_cate')) echo get_option('king_fre_cate');
else echo '0' ?>;
window.cate_wor = <?php if (get_option('king_wor_cate')) echo get_option('king_wor_cate');
else echo '0' ?>;
</script>
<script type="text/javascript" src="<?php echo esc_url(get_template_directory_uri()); ?>/dist/js/archive.js"></script>
<?php get_footer(); ?>