forked from Tokinx/Wing
-
Notifications
You must be signed in to change notification settings - Fork 0
/
page-wall.php
executable file
·40 lines (40 loc) · 1.56 KB
/
page-wall.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
<?php
/*
Template Name: 读者排行
*/
get_header();
?>
<article class="article" itemscope itemtype="https://schema.org/Article">
<?php
if ( have_posts() ) {
while ( have_posts() ) {
the_post();
require_once( "inc/article-header.php" );
}
}; ?>
<ul class="article-cards columns reset-ul" itemprop="articleBody">
<?php foreach ( get_readers_wall() as $comment ) :
$url = $comment->comment_author_url;
$alt = mb_substr( $comment->comment_author, 0, 1 );
$avatar = get_avatar_url( $comment->comment_author_email ); ?>
<li class="column col-3 col-sm-4 col-xs-6 p-2">
<div class="card uni-card uni-shadow flex-center text-center p-2">
<a class="text-gray text-tiny m-2" href="<?= ( $url ?: 'javascript:void(0);' ); ?>"
target="<?= ( $url ? '_blank' : '_self' ); ?>">
<figure class="avatar avatar-xl bg-gray badge" data-badge="<?= $comment->cnt ?>"
data-initial="<?= $alt; ?>">
<img src="<?= $avatar; ?>" alt="<?= $alt; ?>" no-view/>
</figure>
<span class="d-block text-ellipsis mt-1"><?= $comment->comment_author ?></span>
</a>
</div>
</li>
<?php endforeach; ?>
</ul>
</article>
<?php
if ( comments_open() || get_comments_number() ) :
comments_template();
endif;
get_footer();
?>