-
Notifications
You must be signed in to change notification settings - Fork 124
/
index.php
executable file
·51 lines (50 loc) · 2.73 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
<?php get_header(); ?>
<!-- Post List -->
<section class="posts main-load">
<div class="container">
<div class="post-list">
<?php if (have_posts()) {
while (have_posts()): the_post(); ?>
<article class="meta" itemscope="" itemtype="http://schema.org/BlogPosting">
<header>
<a href="<?php the_permalink(); ?>" itemprop="url"><h2 itemprop="name headline"><?php the_title(); ?></h2></a>
</header>
<main>
<?php if (get_theme_mod('biji_setting_thumb') && post_thumbnail(0, 0)) { ?>
<a href="<?php the_permalink(); ?>" class="thumb"
style="background-image: url('<?php echo post_thumbnail(200, 140); ?>');"></a>
<?php }; ?>
<p itemprop="articleBody">
<?php if (post_password_required()) {
the_content();
} else {
$content = get_post_field('post_content', get_the_ID());
$content_parts = get_extended($content);
echo mb_strimwidth(strip_shortcodes(strip_tags(apply_filters('the_content', $post->post_excerpt ?: $content_parts['main']))), 0, 220, '...');
} ?>
</p>
</main>
<footer>
<span class="time"><time datetime="<?php echo get_the_time('c'); ?>" title="<?php echo get_the_time('c'); ?>"
itemprop="datePublished" pubdate><?php the_time('Y-m-d'); ?></time>发布</span>
<span class="hr"></span>
<span class="comments"><?php comments_number('0', '1', '%'); ?> 条评论</span>
<?php echo get_post_meta($post->ID, 'dotGood', true) ? '<span class="hr"></span><span class="likes">' . get_post_meta($post->ID, 'dotGood', true) . ' 人喜欢</span>' : ''; ?>
</footer>
</article>
<?php endwhile;
} else { ?>
<article class="meta">
<h3 style="font-size: 3em;margin: 0 0 20px;">Sorry!</h3>
<p>这个页面没有你要找的内容。</p>
</article>
<?php }; ?>
<nav class="reade_more">
<?php if (function_exists('pagenavi')) {
pagenavi(1);
} ?>
</nav>
</div>
</div>
</section>
<?php get_footer(); ?>