评论区硬切换实现小修复

This commit is contained in:
2026-08-30 19:04:41 +08:00
parent 0e1b0ce86e
commit 65fbf97099
8 changed files with 29 additions and 26 deletions
+7
View File
@@ -89,6 +89,13 @@
#postcomments .commentlist > .comment > .list-inline .author-box {
align-items: start;
/* 阻断外部作者卡片样式(如 single-post/author-actions 的 .author-box 卡片)
渗入评论头部:legacy 中评论头部是无装饰的 flex 行。 */
margin-bottom: 0;
padding: 0;
background: none;
border-radius: 0;
box-shadow: none;
}
#postcomments .commentlist > .comment > .list-inline .comment-footer {
+1 -1
View File
File diff suppressed because one or more lines are too long
+2 -8
View File
@@ -1147,14 +1147,8 @@ html.dark .post-drop-meta__item:hover {
}
/* ===== Author Card — 对齐 legacy 卡片容器 ===== */
.author-box {
margin-bottom: 16px;
padding: 18px;
background: var(--surface-1, #fff);
border: none;
border-radius: var(--radius-2xl, 16px);
box-shadow: var(--shadow-sm);
}
/* 原 .author-box 卡片规则已删除:全站仅评论区使用 .author-box(无装饰 flex 行,
由 comments/layout.css 接管),文章作者条使用 .article-author-bar。 */
.single-metabox {
display: flex;
+1 -1
View File
File diff suppressed because one or more lines are too long
+7
View File
@@ -88,6 +88,13 @@
#postcomments .commentlist > .comment > .list-inline .author-box {
align-items: start;
/* 阻断外部作者卡片样式(如 single-post/author-actions 的 .author-box 卡片)
渗入评论头部:legacy 中评论头部是无装饰的 flex 行。 */
margin-bottom: 0;
padding: 0;
background: none;
border-radius: 0;
box-shadow: none;
}
#postcomments .commentlist > .comment > .list-inline .comment-footer {
@@ -407,14 +407,8 @@ html.dark .post-drop-meta__item:hover {
}
/* ===== Author Card — 对齐 legacy 卡片容器 ===== */
.author-box {
margin-bottom: 16px;
padding: 18px;
background: var(--surface-1, #fff);
border: none;
border-radius: var(--radius-2xl, 16px);
box-shadow: var(--shadow-sm);
}
/* 原 .author-box 卡片规则已删除:全站仅评论区使用 .author-box(无装饰 flex 行,
由 comments/layout.css 接管),文章作者条使用 .article-author-bar。 */
.single-metabox {
display: flex;
+1 -1
View File
@@ -477,7 +477,7 @@ if (!function_exists('aksrt_comments_render_form')) :
<div class="comt-avatar mb10">
<?php echo get_avatar($current_user->ID, 60, '', '', ['class' => 'avatar']); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</div>
<p class="text-ellipsis muted-2-color"><?php echo function_exists('aksrt_render_user_identity_chips') ? aksrt_render_user_identity_chips($current_user->ID, 'comment') : ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- chips 内部已转义。 ?><?php echo esc_html($current_user->display_name); ?></p>
<p class="text-ellipsis muted-2-color"><?php echo function_exists('aksrt_render_vip_badge') ? aksrt_render_vip_badge($current_user->ID) : ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- vip 徽章内部已转义。 ?><?php echo esc_html($current_user->display_name); ?></p>
<?php else : ?>
<div class="comt-avatar mb10">
<?php echo get_avatar(0, 60, '', '', ['class' => 'avatar']); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
+8 -7
View File
@@ -123,14 +123,15 @@ if (!function_exists('aksrt_get_comment_city_badge_html')) :
if (!aksrt_comment_city_enabled()) {
return '';
}
if (function_exists('aksrt_get_geo_badge_html')) {
return aksrt_get_geo_badge_html(
aksrt_get_comment_addr($comment),
aksrt_comment_city_type(),
'badg badg-sm comment-city-badge'
);
// legacy 契约:无属地数据时不渲染徽章(不使用查询失败兜底文案)。
$addr = aksrt_get_comment_addr($comment);
$label = function_exists('aksrt_format_geo_label')
? aksrt_format_geo_label(is_array($addr) ? $addr : [], aksrt_comment_city_type())
: '';
if ($label === '') {
return '';
}
return '';
return '<span class="badg badg-sm comment-city-badge aksrt-ip-geo-badge" title="' . esc_attr__('IP 属地', 'aksrt') . '">' . esc_html($label) . '</span>';
}
endif;