fix(widgets): always render article sidebar container

This commit is contained in:
kate522 committed 2026-08-14 13:30:07 +08:00
1 parent 92a4631dff
commit 5444b8eabe
1 file changed
+7 -1
+7 -1
View File
@@ -52,10 +52,16 @@ if (!function_exists('aksrt_single_render_aside')) :
* @param array<string,mixed> $ctx Single context. * @param array<string,mixed> $ctx Single context.
*/ */
function aksrt_single_render_aside(array $ctx): void { function aksrt_single_render_aside(array $ctx): void {
if (empty($ctx['show_aside'])) { $post_id = (int) ($ctx['post_id'] ?? get_the_ID());
if (get_post_type($post_id) !== 'post') {
return; return;
} }
// The body site-layout-* class owns visibility. Always render the post
// sidebar so User-Agent or request-specific context cannot remove widgets
// from an otherwise two-column article page.
$has_article_widgets = is_active_sidebar('all_sidebar_top') $has_article_widgets = is_active_sidebar('all_sidebar_top')
|| is_active_sidebar('sidebar-article') || is_active_sidebar('sidebar-article')
|| is_active_sidebar('all_sidebar_bottom'); || is_active_sidebar('all_sidebar_bottom');