-
Notifications
You must be signed in to change notification settings - Fork 29
/
index.php
59 lines (56 loc) · 1.64 KB
/
index.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
<?php get_header(); ?>
<div id="ctn">
<div id="content">
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<article <?php post_class(); ?>>
<?php get_template_part('content'); ?>
</article>
<?php endwhile; ?>
<div id="page_nav">
<?php
$pagination = array(
'base' => @add_query_arg('paged', '%#%'),
'format' => '',
'total' => $wp_query->max_num_pages,
'current' => max($wp_query->query_vars['paged'], 1),
'show_all' => false,
'type' => 'plain',
'end_size' => '0',
'mid_size' => '5',
'prev_text' => __('上一页', 'clrs'),
'next_text' => __('下一页', 'clrs')
);
if ($wp_rewrite->using_permalinks()) {
$pagination['base'] = user_trailingslashit(trailingslashit(remove_query_arg('s', get_pagenum_link(1))) . 'page/%#%/', 'paged');
}
if (!empty($wp_query->query_vars['s'])) {
$pagination['add_args'] = array('s' => get_query_var('s'));
}
echo (paginate_links($pagination));
?>
</div>
<?php else : ?>
<div class="post_ctn">
<div class="post_h_l">
<h2 class="post_h"><?php _e('什么都没有找到', 'clrs'); ?></h2>
</div>
<div class="post_t">
<?php
echo ('<p>' . __('哎呀,你要找的东西好像被贝爷吃掉了……', 'clrs') . '</p>');
get_search_form();
?>
</div>
</div>
<?php endif; ?>
</div>
</div>
<div id="link" style="display:<?php echo get_option('clrs_ldis') ? "block" : "none"; ?>">
<div id="link_content">
<h3 id="link_h"><?php _e('友情链接', 'clrs'); ?></h3>
<?php echo get_option('clrs_link'); ?>
</div>
</div>
<?php
get_sidebar();
get_footer();