forked from Tokinx/Wing
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
executable file
·67 lines (67 loc) · 3.65 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
60
61
62
63
64
65
66
67
<?php if ( ! defined( 'ABSPATH' ) ) { exit; } get_header(); ?>
<!-- 文章列表 -->
<div class="article-list">
<?php if ( have_posts() ) {
while ( have_posts() ) : the_post(); ?>
<article class="article-item" itemscope="itemscope" itemtype="http://schema.org/Article">
<a href="<?php the_permalink(); ?>" class="article-mask" title="<?php the_title(); ?>">
<?php if ( ! post_password_required() && $thumbnail = get_thumbnail() ) { ?>
<div class="article-thumbnail" style="background-image: url('<?= $thumbnail; ?>');"></div>
<?php } else { ?>
<div class="article-thumbnail">
<main class="article-body <?= ( post_password_required() ? 'flex-center' : '' ) ?>">
<p class="text-tiny text-gray" itemprop="about">
<?php if ( post_password_required() ) : ?>
<span class="d-block text-center mt-2" style="font-size: 3rem;">
<i class="dashicons dashicons-privacy d-block"></i>
</span>
<?php else :
echo mb_strimwidth( strip_shortcodes( strip_tags( get_the_content() ) ), 0, 300, '...' );
endif; ?>
</p>
</main>
</div>
<?php }; ?>
<header class="article-header">
<h2 class="article-title h5 text-dark text-ellipsis" itemprop="headline">
<?php the_title(); ?>
</h2>
<div class="article-subtitle text-gray">
<ul class="d-flex text-tiny text-gray reset-ul">
<li class="time">
<i class="czs-time"></i>
<time datetime="<?php the_time( 'c' ); ?>" itemprop="datePublished"
pubdate><?php the_time( 'Y-m-d' ); ?></time>
</li>
<li class="comments">
<i class="czs-comment"></i>
<?php comments_number( '0', '1', '%' ); ?>
</li>
<?php if ( $post_praise = get_praise() ) : ?>
<li class="likes">
<i class="czs-heart"></i>
<?= $post_praise ?>
</li>
<?php endif; ?>
</ul>
</div>
</header>
</a>
<meta itemprop="author" content="<?php the_author_meta( 'display_name' ); ?>">
<meta itemprop="publisher" content="<?php bloginfo( 'name' ); ?>">
<meta itemprop="datePublished" content="<?php the_time( 'c' ); ?>">
<meta itemprop="dateModified" content="<?php the_modified_time( 'c' ); ?>">
<?php if($thumbnail):?>
<meta itemprop="image" content="<?=$thumbnail?>">
<?php endif; ?>
</article>
<?php endwhile;
} else { ?>
<article class="meta flex-center w-100" style="padding: 20% 0;flex-direction: column;">
<h1>404</h1>
<p>This page doesn't have what you're looking for.</p>
</article>
<?php }; ?>
</div>
<?php the_pagination() ?>
<?php get_footer(); ?>