清 single/home 残层:删 sidebar prepend 与 author-bar query-var
去掉 generic sidebar 的 prepend patch、author-bar ambient 回退, 以及 homepage section 多余 wrapper,保持主线闭环更干净。
This commit is contained in:
+19
-24
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
/**
|
||||
* Sidebar template.
|
||||
* Sidebar template for generic pages.
|
||||
*
|
||||
* Single/home own their asides. This template only serves archive/page contexts.
|
||||
*
|
||||
* @package AKSRT
|
||||
*/
|
||||
@@ -8,37 +10,30 @@
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
if (wp_is_mobile()) {
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
$sidebar_id = function_exists('aksrt_resolve_sidebar_id')
|
||||
? aksrt_resolve_sidebar_id()
|
||||
: 'sidebar-blog';
|
||||
? aksrt_resolve_sidebar_id()
|
||||
: 'sidebar-blog';
|
||||
|
||||
$sidebar_prepend_html = (string) get_query_var('aksrt_sidebar_prepend_html', '');
|
||||
|
||||
if ($sidebar_prepend_html === ''
|
||||
&& !is_active_sidebar($sidebar_id)
|
||||
&& !is_active_sidebar('all_sidebar_top')
|
||||
&& !is_active_sidebar('all_sidebar_bottom')) {
|
||||
return;
|
||||
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 ($sidebar_prepend_html !== '') : ?>
|
||||
<?php echo $sidebar_prepend_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
<?php endif; ?>
|
||||
<?php if (is_active_sidebar('all_sidebar_top')) : ?>
|
||||
<?php dynamic_sidebar('all_sidebar_top'); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?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($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; ?>
|
||||
<?php if (is_active_sidebar('all_sidebar_bottom')) : ?>
|
||||
<?php dynamic_sidebar('all_sidebar_bottom'); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user