Files
wordpress-theme-aksrt/single.php
T
kate522 29bd9bd152 Zibll 主线收口:减层统一 single 与首页主内容流
把 single.php 收成薄壳,文章组合迁入 aksrt-single;
首页去掉 legacy module 桥接与多余 stream 文案层,
保留 renderer / tab-panel / sort 协议并形成页面自有 aside。
2026-07-09 21:49:46 +08:00

104 lines
3.5 KiB
PHP

<?php
/**
* Single post template — thin Zibll-style shell.
*
* Composition lives in inc/helpers/aksrt-single.php.
*
* @package AKSRT
*/
defined('ABSPATH') || exit;
wp_reset_postdata();
get_header();
while (have_posts()) :
the_post();
$post_id = (int) get_the_ID();
$ctx = function_exists('aksrt_single_build_context')
? aksrt_single_build_context($post_id)
: ['show_aside' => false, 'settings' => []];
if (function_exists('aksrt_single_is_docs_page') && aksrt_single_is_docs_page($post_id)) {
get_template_part('templates/pages/page-documentnav');
get_footer();
return;
}
$settings = is_array($ctx['settings'] ?? null) ? $ctx['settings'] : [];
$show_aside = !empty($ctx['show_aside']);
?>
<?php if (!empty($settings['reading_progress'])) : ?>
<div id="reading-progress-global" class="reading-progress-bar" role="progressbar" aria-label="<?php esc_attr_e('阅读进度', 'aksrt'); ?>" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"></div>
<?php endif; ?>
<?php if (function_exists('dynamic_sidebar')) : ?>
<div class="fluid-widget-wrap">
<?php dynamic_sidebar('all_top_fluid'); ?>
<?php dynamic_sidebar('single_top_fluid'); ?>
</div>
<?php endif; ?>
<main id="main-content" role="main" class="site-main container content-shell content-shell--stream content-shell--single" tabindex="-1">
<div class="content-wrap">
<div class="content-layout<?php echo $show_aside ? '' : ' content-layout--no-sidebar'; ?>">
<div class="content-layout__primary">
<?php if (is_active_sidebar('single_top_content')) : ?>
<div class="aksrt-single-widget-area aksrt-single-widget-area--top">
<?php dynamic_sidebar('single_top_content'); ?>
</div>
<?php endif; ?>
<?php
if (function_exists('aksrt_single')) {
aksrt_single($ctx);
}
?>
<?php if (comments_open() || get_comments_number()) : ?>
<div class="theme-box box-body radius8 main-shadow comments-card">
<?php comments_template(); ?>
</div>
<?php endif; ?>
<?php if (is_active_sidebar('single_bottom_content')) : ?>
<div class="aksrt-single-widget-area aksrt-single-widget-area--bottom">
<?php dynamic_sidebar('single_bottom_content'); ?>
</div>
<?php endif; ?>
</div>
<?php
if (function_exists('aksrt_single_render_aside')) {
aksrt_single_render_aside($ctx);
}
?>
</div>
</div>
</main>
<?php if (function_exists('dynamic_sidebar')) : ?>
<div class="fluid-widget-wrap">
<?php dynamic_sidebar('single_bottom_fluid'); ?>
<?php dynamic_sidebar('all_bottom_fluid'); ?>
</div>
<?php endif; ?>
<?php if (!empty($ctx['show_toc'])) : ?>
<button type="button" class="toc-float-btn" aria-label="<?php esc_attr_e('打开目录', 'aksrt'); ?>"><i class="fas fa-list-ul" aria-hidden="true"></i></button>
<div class="toc-drawer-overlay"></div>
<aside class="toc-drawer posts-nav-box" data-title="<?php echo esc_attr((string) ($ctx['toc_title'] ?? __('文章目录', 'aksrt'))); ?>" aria-label="<?php echo esc_attr((string) ($ctx['toc_title'] ?? __('文章目录', 'aksrt'))); ?>">
<div class="toc-drawer__head">
<h3><?php echo esc_html((string) ($ctx['toc_title'] ?? __('文章目录', 'aksrt'))); ?></h3>
<button type="button" class="toc-drawer__close" aria-label="<?php esc_attr_e('关闭目录', 'aksrt'); ?>"><i class="fas fa-times" aria-hidden="true"></i></button>
</div>
<ol class="toc-list"></ol>
</aside>
<?php endif; ?>
<?php endwhile; ?>
<?php get_footer(); ?>