Remove deprecated widget locations and widgets, standardize sidebar labels, and render a compact paid-post purchase card in the article sidebar.
38 lines
1.0 KiB
PHP
38 lines
1.0 KiB
PHP
<?php
|
|
/**
|
|
* Sidebar template for generic pages.
|
|
*
|
|
* Single/home own their asides. This template only serves archive/page contexts.
|
|
* Callers only include this when aksrt_is_show_sidebar() is true.
|
|
* Keep the column even if widgets are empty (zibll parity).
|
|
*
|
|
* @package AKSRT
|
|
*/
|
|
|
|
defined('ABSPATH') || exit;
|
|
|
|
if (wp_is_mobile()) {
|
|
return;
|
|
}
|
|
|
|
$sidebar_id = function_exists('aksrt_resolve_sidebar_id')
|
|
? aksrt_resolve_sidebar_id()
|
|
: 'home_sidebar';
|
|
?>
|
|
|
|
<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 elseif ((is_home() || is_front_page()) && is_active_sidebar('home_sidebar')) : ?>
|
|
<?php dynamic_sidebar('home_sidebar'); ?>
|
|
<?php endif; ?>
|
|
|
|
<?php if (is_active_sidebar('all_sidebar_bottom')) : ?>
|
|
<?php dynamic_sidebar('all_sidebar_bottom'); ?>
|
|
<?php endif; ?>
|
|
</div>
|