34 lines
784 B
PHP
34 lines
784 B
PHP
<?php
|
|
/**
|
|
* Single-post sidebar composition.
|
|
*
|
|
* @package AKSRT
|
|
*/
|
|
|
|
defined('ABSPATH') || exit;
|
|
|
|
if (!function_exists('aksrt_single_render_aside')) :
|
|
/**
|
|
* Render the article sidebar: widget areas only, legacy sidebar.php parity.
|
|
*
|
|
* @param array<string,mixed> $ctx Single context.
|
|
*/
|
|
function aksrt_single_render_aside(array $ctx): void {
|
|
$post_id = (int) ($ctx['post_id'] ?? get_the_ID());
|
|
|
|
if (get_post_type($post_id) !== 'post' || empty($ctx['show_aside'])) {
|
|
return;
|
|
}
|
|
|
|
?>
|
|
<div class="sidebar aksrt-article-sidebar" role="complementary" aria-label="<?php esc_attr_e('侧栏', 'aksrt'); ?>">
|
|
<?php
|
|
dynamic_sidebar('all_sidebar_top');
|
|
dynamic_sidebar('single_sidebar');
|
|
dynamic_sidebar('all_sidebar_bottom');
|
|
?>
|
|
</div>
|
|
<?php
|
|
}
|
|
endif;
|