fix(widgets): always render article sidebar container

This commit is contained in:
2026-08-14 13:30:07 +08:00
parent 92a4631dff
commit 5444b8eabe
+7 -1
View File
@@ -52,10 +52,16 @@ if (!function_exists('aksrt_single_render_aside')) :
* @param array<string,mixed> $ctx Single context.
*/
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;
}
// 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')
|| is_active_sidebar('sidebar-article')
|| is_active_sidebar('all_sidebar_bottom');