fix: collapse empty homepage sidebar
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user