fix: collapse empty homepage sidebar

This commit is contained in:
2026-08-14 14:12:17 +08:00
parent f6134f4458
commit 15b4c818c5
3 changed files with 47 additions and 12 deletions
+12 -5
View File
@@ -146,14 +146,21 @@ if (!function_exists('aksrt_homepage_has_sidebar')) {
* Whether the fixed homepage should render an aside column.
*/
function aksrt_homepage_has_sidebar(): bool {
$has_widgets = function_exists('aksrt_has_current_sidebar_widgets')
? aksrt_has_current_sidebar_widgets()
: aksrt_homepage_has_active_sidebars([
'all_sidebar_top',
'home_sidebar',
'all_sidebar_bottom',
]);
if (!$has_widgets) {
return false;
}
if (function_exists('aksrt_is_show_sidebar')) {
return aksrt_is_show_sidebar();
}
return aksrt_homepage_has_active_sidebars([
'all_sidebar_top',
'home_sidebar',
'all_sidebar_bottom',
]);
return true;
}
}