fix(frontend): unbreak single post layout cascade

Disable the global 2-col .content-layout grid on single pages (it was
tiling breadcrumb/article/author/related/comments left-right), add the
missing Zibll utility bridge used by the author/meta bar, and replace
nonstandard <name>/<item>/<badge> tags in the single surface.
This commit is contained in:
2026-07-14 23:38:50 +08:00
parent ffd3d0f6c5
commit db361fcc3f
7 changed files with 169 additions and 16 deletions
+8 -8
View File
@@ -73,13 +73,13 @@ if (!function_exists('aksrt_get_posts_meta_items_html')) :
? 'javascript:(typeof scrollTopTo===\'function\'?scrollTopTo(\'#comments\'):void(0));'
: get_comments_link($post_id);
$count = (int) get_comments_number($post_id);
$html .= '<item class="meta-comm"><a rel="nofollow" href="' . esc_attr($href) . '" title="' . esc_attr__('去评论', 'aksrt') . '">'
. '<i class="fa fa-comment-o" aria-hidden="true"></i> ' . esc_html((string) $count) . '</a></item>';
$html .= '<span class="item meta-comm"><a rel="nofollow" href="' . esc_attr($href) . '" title="' . esc_attr__('去评论', 'aksrt') . '">'
. '<i class="fa fa-comment-o" aria-hidden="true"></i> ' . esc_html((string) $count) . '</a></span>';
}
$views = function_exists('aksrt_get_post_views') ? (int) aksrt_get_post_views($post_id) : 0;
$views_label = function_exists('aksrt_format_number') ? aksrt_format_number($views) : number_format_i18n($views);
$html .= '<item class="meta-view"><i class="fa fa-eye" aria-hidden="true"></i> ' . esc_html((string) $views_label) . '</item>';
$html .= '<span class="item meta-view"><i class="fa fa-eye" aria-hidden="true"></i> ' . esc_html((string) $views_label) . '</span>';
$like_on = true;
if (class_exists('AKSRT_Settings')) {
@@ -88,7 +88,7 @@ if (!function_exists('aksrt_get_posts_meta_items_html')) :
}
if ($like_on && $post->post_type === 'post') {
$likes = function_exists('aksrt_get_post_likes') ? (int) aksrt_get_post_likes($post_id) : 0;
$html .= '<item class="meta-like"><i class="fa fa-heart-o" aria-hidden="true"></i> ' . esc_html((string) $likes) . '</item>';
$html .= '<span class="item meta-like"><i class="fa fa-heart-o" aria-hidden="true"></i> ' . esc_html((string) $likes) . '</span>';
}
return $html;
@@ -154,8 +154,8 @@ if (!function_exists('aksrt_get_post_status_badge')) :
if (!isset($map[$status])) {
return '';
}
return '<badge class="img-badge right ' . esc_attr($map[$status]['class']) . '">'
. esc_html($map[$status]['label']) . '</badge>';
return '<span class="badge img-badge right ' . esc_attr($map[$status]['class']) . '">'
. esc_html($map[$status]['label']) . '</span>';
}
endif;
@@ -504,8 +504,8 @@ if (!function_exists('aksrt_render_related_graphic_card')) :
$html .= '<img ' . $img_attrs . ' alt="' . esc_attr($title) . '">';
$html .= '<div class="abs-center left-bottom graphic-text">';
$html .= '<div class="text1 text-ellipsis">' . esc_html($title) . '</div>';
$html .= '<div class="text3 muted-2-color em09"><item>' . esc_html($time) . '</item>';
$html .= '<item class="pull-right"><i class="fa fa-eye" aria-hidden="true"></i> ' . esc_html((string) $views_label) . '</item></div>';
$html .= '<div class="text3 muted-2-color em09"><span class="item">' . esc_html($time) . '</span>';
$html .= '<span class="item pull-right"><i class="fa fa-eye" aria-hidden="true"></i> ' . esc_html((string) $views_label) . '</span></div>';
$html .= '</div></div></a></div></div>';
return $html;
}
+6 -4
View File
@@ -363,7 +363,8 @@ if (!function_exists('aksrt_single_render_actions')) :
$is_favorited = !empty($ctx['is_favorited']);
?>
<div class="text-center muted-3-color box-body em09"><?php echo esc_html($settings['button_toptext'] ?? __('喜欢就支持一下吧', 'aksrt')); ?></div>
<div class="text-center post-actions">
<div class="post-actions-wrap relative">
<div class="text-center post-actions">
<?php if (!empty($settings['like_enabled'])) : ?>
<button type="button" class="action action-like<?php echo $is_liked ? ' is-active' : ''; ?>" id="action-like" data-post-id="<?php echo esc_attr((string) $post_id); ?>" data-initial-active="<?php echo $is_liked ? '1' : '0'; ?>">
<i class="<?php echo $is_liked ? 'fas' : 'far'; ?> fa-heart" aria-hidden="true"></i>
@@ -391,9 +392,9 @@ if (!function_exists('aksrt_single_render_actions')) :
<span class="action-btn__count" data-stat-count="favorites" data-base-count="<?php echo esc_attr((string) $favorite_count); ?>"><?php echo esc_html((string) $favorite_count); ?></span>
</button>
<?php endif; ?>
</div>
</div>
<?php if (!empty($settings['share_enabled'])) : ?>
<?php if (!empty($settings['share_enabled'])) : ?>
<div class="share-dropdown" id="share-dropdown" aria-hidden="true">
<div class="share-dropdown__grid">
<button type="button" class="share-item" data-platform="qq"><i class="fab fa-qq"></i><span>QQ</span></button>
@@ -404,7 +405,8 @@ if (!function_exists('aksrt_single_render_actions')) :
</div>
<div id="share-qrcode-box" aria-hidden="true"><img id="share-qrcode-image" src="" alt="QR Code"></div>
</div>
<?php endif; ?>
<?php endif; ?>
</div>
<?php if (!empty($settings['rewards_enabled']) && !empty($settings['rewards_image'])) : ?>
<div class="reward-modal" id="reward-modal" aria-hidden="true">