- assets/vendor 全量迁移: fontawesome5→assets/fontawesome5, css→assets/css, js→assets/js/runtime(避开 14 个同名自有文件), img 合并去重→assets/img, fonts→assets/fonts; 删除 assets/vendor - libs 五个与 widgets/third-party 字节相同的库不重复入库, loader paths 改指向 - 运行时切换: _win.uri=assets 根, loader baseUrl=/js/runtime, enlighter 注入 路径同步; PHP 7 个引用文件切换并改名 $zibll_*→$runtime_* - 去品牌: Qinver 头注释/品牌 console.log/演示链接清除, 默认文案中性化 - 功能标识符改名: zib__→aksrt__, zib_ajax→aksrt_ajax, window.zib→ window.aksrtLegacy, zibllblock/*→aksrtblock/*, .zib-widget→.aksrt-panel, .zib-slider→.aksrt-slider, zib_menu_options meta 键等 - 自有 CSS 改名: legacy-utilities/compat-vars/footer shell - admin SPA 重建; 契约测试同步(路径/断言/文件更名) - 例外保留: tests/visual 对照环境与 fixtures 前缀(外部 Zibll 产品引用) 验证: php -l 133 个改动文件通过; runtime 86 个 JS node --check 通过; 契约测试 68/70(2 个失败经 stash 对照确认为存量问题)
118 lines
4.1 KiB
PHP
118 lines
4.1 KiB
PHP
<?php
|
|
/**
|
|
* 固定页面模板
|
|
*
|
|
* @package AKSRT
|
|
*/
|
|
|
|
defined('ABSPATH') || exit;
|
|
|
|
get_header();
|
|
|
|
$page_settings = class_exists('\AKSRT\Settings\Settings')
|
|
? \AKSRT\Settings\Settings::get_post_page_settings()
|
|
: ['reading_progress' => false, 'lightbox' => true];
|
|
$page_id = get_queried_object_id();
|
|
$page_content_style = get_post_meta($page_id, 'page_content_style', true);
|
|
$page_content_style = $page_content_style !== '' ? sanitize_html_class($page_content_style) : 'default';
|
|
$show_sidebar = function_exists('aksrt_is_show_sidebar') ? aksrt_is_show_sidebar() : true;
|
|
?>
|
|
|
|
<?php if (!empty($page_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
|
|
// legacy page.php: fluid top OUTSIDE main; main.container + content-wrap/layout + sidebar sibling.
|
|
// Do not put content-shell padding/max-width on the dual-column host (breaks float math).
|
|
?>
|
|
<?php if (is_active_sidebar('page_top_fluid_' . $page_id)) : ?>
|
|
<div class="fluid-widget-wrap">
|
|
<?php dynamic_sidebar('page_top_fluid_' . $page_id); ?>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<main id="main-content" class="site-main container page-content-<?php echo esc_attr($page_content_style); ?> page-id-<?php echo esc_attr((string) $page_id); ?>" tabindex="-1">
|
|
<div class="content-wrap">
|
|
<div class="content-layout">
|
|
<?php if (is_active_sidebar('page_top_content_' . $page_id)) : ?>
|
|
<?php dynamic_sidebar('page_top_content_' . $page_id); ?>
|
|
<?php endif; ?>
|
|
|
|
<?php
|
|
while (have_posts()) :
|
|
the_post();
|
|
|
|
$page_meta_header_style = get_post_meta(get_the_ID(), 'page_header_style', true);
|
|
$ph_style_override = null;
|
|
if ($page_meta_header_style !== '' && in_array($page_meta_header_style, ['', '1', '2', '3', 'not'], true)) {
|
|
$ph_style_override = ($page_meta_header_style === 'not') ? '' : $page_meta_header_style;
|
|
}
|
|
$page_cover = (string) get_post_meta(get_the_ID(), 'page_header_cover_img', true);
|
|
$header_args = [
|
|
'title' => get_the_title(),
|
|
];
|
|
if ($ph_style_override !== null) {
|
|
$header_args['style'] = $ph_style_override;
|
|
}
|
|
if ($page_cover !== '') {
|
|
$header_args['cover'] = esc_url($page_cover);
|
|
}
|
|
?>
|
|
<article <?php post_class('entry-page'); ?>>
|
|
<?php get_template_part('templates/parts/page-header', null, $header_args); ?>
|
|
|
|
<?php if (has_post_thumbnail()) : ?>
|
|
<figure class="entry-thumb">
|
|
<?php the_post_thumbnail('large'); ?>
|
|
</figure>
|
|
<?php endif; ?>
|
|
|
|
<div class="entry-content" data-aksrt-lightbox="<?php echo !empty($page_settings['lightbox']) ? '1' : '0'; ?>">
|
|
<?php the_content(); ?>
|
|
<?php
|
|
wp_link_pages([
|
|
'before' => '<nav class="page-links"><span class="page-links-title">' . esc_html__('分页:', 'aksrt') . '</span>',
|
|
'after' => '</nav>',
|
|
]);
|
|
?>
|
|
</div>
|
|
</article>
|
|
|
|
<?php
|
|
if (comments_open() || get_comments_number()) {
|
|
echo '<div class="theme-box box-body radius8 main-shadow comments-card">';
|
|
comments_template();
|
|
echo '</div>';
|
|
}
|
|
|
|
endwhile;
|
|
?>
|
|
|
|
<?php if (is_active_sidebar('page_bottom_content_' . $page_id)) : ?>
|
|
<?php dynamic_sidebar('page_bottom_content_' . $page_id); ?>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|
|
<?php if ($show_sidebar) : ?>
|
|
<?php get_sidebar(); ?>
|
|
<?php endif; ?>
|
|
</main>
|
|
|
|
<?php if (is_active_sidebar('page_bottom_fluid_' . $page_id)) : ?>
|
|
<div class="fluid-widget-wrap">
|
|
<?php dynamic_sidebar('page_bottom_fluid_' . $page_id); ?>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<?php if (!empty($page_settings['lightbox'])) : ?>
|
|
<div class="lightbox-overlay" id="lightbox-overlay" role="dialog" aria-modal="true" aria-label="<?php esc_attr_e('图片预览', 'aksrt'); ?>">
|
|
<button type="button" class="lightbox-close" aria-label="<?php esc_attr_e('关闭', 'aksrt'); ?>"><i class="fa fas fa-times"></i></button>
|
|
<img src="" alt="" class="lightbox-img">
|
|
<div class="lightbox-caption" aria-live="polite"></div>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<?php
|
|
get_footer();
|