去掉 generic sidebar 的 prepend patch、author-bar ambient 回退, 以及 homepage section 多余 wrapper,保持主线闭环更干净。
40 lines
925 B
PHP
40 lines
925 B
PHP
<?php
|
|
/**
|
|
* Sidebar template for generic pages.
|
|
*
|
|
* Single/home own their asides. This template only serves archive/page contexts.
|
|
*
|
|
* @package AKSRT
|
|
*/
|
|
|
|
defined('ABSPATH') || exit;
|
|
|
|
if (wp_is_mobile()) {
|
|
return;
|
|
}
|
|
|
|
$sidebar_id = function_exists('aksrt_resolve_sidebar_id')
|
|
? aksrt_resolve_sidebar_id()
|
|
: 'sidebar-blog';
|
|
|
|
if (!is_active_sidebar($sidebar_id)
|
|
&& !is_active_sidebar('all_sidebar_top')
|
|
&& !is_active_sidebar('all_sidebar_bottom')) {
|
|
return;
|
|
}
|
|
?>
|
|
|
|
<div class="sidebar" role="complementary" aria-label="<?php esc_attr_e('侧栏', 'aksrt'); ?>">
|
|
<?php if (is_active_sidebar('all_sidebar_top')) : ?>
|
|
<?php dynamic_sidebar('all_sidebar_top'); ?>
|
|
<?php endif; ?>
|
|
|
|
<?php if (is_active_sidebar($sidebar_id)) : ?>
|
|
<?php dynamic_sidebar($sidebar_id); ?>
|
|
<?php endif; ?>
|
|
|
|
<?php if (is_active_sidebar('all_sidebar_bottom')) : ?>
|
|
<?php dynamic_sidebar('all_sidebar_bottom'); ?>
|
|
<?php endif; ?>
|
|
</div>
|