v1.10 — 评论时间/回复按钮/时区修复

- 自定义评论列表渲染(无 at 后缀,中文时间 Y-m-d H:i:s)
- 回复链接恢复
- 时区设为 Asia/Shanghai
- 评论样式优化
This commit is contained in:
2026-05-04 13:57:52 +08:00
parent fef6379522
commit 7619cfbee1
3 changed files with 34 additions and 9 deletions
+13 -9
View File
@@ -12,17 +12,21 @@ if (post_password_required()) return;
<?php if (have_comments()) : ?>
<ol class="comment-list">
<?php
wp_list_comments(array(
'style' => 'ol',
'avatar_size' => 24,
'short_ping' => true,
'callback' => null,
'reply_text' => '回复',
'format' => 'html5',
));
$comments = get_comments(array('post_id' => get_the_ID(), 'status' => 'approve', 'order' => 'ASC'));
foreach ($comments as $c) :
$c_user = get_user_by('email', $c->comment_author_email);
?>
<li class="comment-item">
<div class="comment-item__meta">
<?php echo get_avatar($c, 22, '', '', array('class' => 'comment-avatar')); ?>
<span class="comment-item__author"><?php echo esc_html($c->comment_author); ?></span>
<span class="comment-item__time"><?php echo get_comment_date('Y-m-d H:i:s', $c); ?></span>
</div>
<div class="comment-item__text"><?php echo esc_html($c->comment_content); ?></div>
<div class="comment-item__reply"><a href="<?php echo esc_url(add_query_arg('replytocom', $c->comment_ID, get_permalink() . '#respond')); ?>">回复</a></div>
</li>
<?php endforeach; ?>
</ol>
<?php the_comments_navigation(); ?>
<?php endif; ?>
<?php if (is_user_logged_in()) : ?>