Files
wordpress-theme-aksrt/sidebar.php
T

45 lines
1.1 KiB
PHP

<?php
/**
* Sidebar template.
*
* @package AKSRT
*/
defined('ABSPATH') || exit;
if (wp_is_mobile()) {
return;
}
$sidebar_id = function_exists('aksrt_resolve_sidebar_id')
? 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;
}
?>
<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($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>