专用页对齐 content-shell,并删 page-header query-var 回退
archives/friends/newposts/posts-navs/categories 统一壳层与 page-header 契约, 主路径不再保留 aksrt_ph_* ambient 传参。
This commit is contained in:
1 parent
9fd0735e97
commit
8849540fda
6 files changed
+228
-210
No files matched your search
@@ -13,47 +13,53 @@ defined('ABSPATH') || exit;
|
||||
get_header();
|
||||
|
||||
$categories = get_categories(['hide_empty' => true, 'orderby' => 'count', 'order' => 'DESC', 'number' => 20]);
|
||||
$tags = get_tags(['hide_empty' => true, 'orderby' => 'count', 'order' => 'DESC', 'number' => 40]);
|
||||
$tags = get_tags(['hide_empty' => true, 'orderby' => 'count', 'order' => 'DESC', 'number' => 40]);
|
||||
|
||||
if (function_exists('aksrt_archive_open_shell')) {
|
||||
aksrt_archive_open_shell([
|
||||
'main_class' => 'site-main container content-shell content-shell--page page-content-default',
|
||||
'has_sidebar' => false,
|
||||
'page_kind' => 'posts-navs',
|
||||
]);
|
||||
}
|
||||
?>
|
||||
<div class="content-main content-main--page content-main--posts-navs">
|
||||
<?php
|
||||
get_template_part('templates/parts/page-header', null, [
|
||||
'title' => esc_html(get_the_title() ?: __('文章导航', 'aksrt')),
|
||||
]);
|
||||
?>
|
||||
|
||||
<main id="main-content" class="container page-content-default" tabindex="-1">
|
||||
<header class="page-header">
|
||||
<h1 class="entry-title"><?php echo esc_html(get_the_title() ?: __('文章导航', 'aksrt')); ?></h1>
|
||||
</header>
|
||||
|
||||
<div class="content-wrap">
|
||||
<div class="content-layout content-layout--no-sidebar">
|
||||
<div class="content-layout__primary">
|
||||
<div class="aksrt-posts-navs container">
|
||||
<?php if (!empty($categories)) : ?>
|
||||
<section class="aksrt-posts-navs__section">
|
||||
<h2 class="aksrt-posts-navs__heading"><?php esc_html_e('热门分类', 'aksrt'); ?></h2>
|
||||
<div class="aksrt-posts-navs__cats">
|
||||
<?php foreach ($categories as $cat) : ?>
|
||||
<a href="<?php echo esc_url(get_category_link($cat->term_id)); ?>" class="aksrt-posts-navs__cat-chip">
|
||||
<span class="aksrt-posts-navs__cat-name"><?php echo esc_html($cat->name); ?></span>
|
||||
<span class="aksrt-posts-navs__cat-count"><?php echo esc_html($cat->count); ?></span>
|
||||
</a>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($tags)) : ?>
|
||||
<section class="aksrt-posts-navs__section">
|
||||
<h2 class="aksrt-posts-navs__heading"><?php esc_html_e('热门标签', 'aksrt'); ?></h2>
|
||||
<div class="aksrt-posts-navs__tags">
|
||||
<?php foreach ($tags as $tag) : ?>
|
||||
<a href="<?php echo esc_url(get_tag_link($tag->term_id)); ?>" class="aksrt-posts-navs__tag"><?php echo esc_html($tag->name); ?></a>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
<div class="aksrt-posts-navs">
|
||||
<?php if (!empty($categories)) : ?>
|
||||
<section class="aksrt-posts-navs__section">
|
||||
<h2 class="aksrt-posts-navs__heading"><?php esc_html_e('热门分类', 'aksrt'); ?></h2>
|
||||
<div class="aksrt-posts-navs__cats">
|
||||
<?php foreach ($categories as $cat) : ?>
|
||||
<a href="<?php echo esc_url(get_category_link($cat->term_id)); ?>" class="aksrt-posts-navs__cat-chip">
|
||||
<span class="aksrt-posts-navs__cat-name"><?php echo esc_html($cat->name); ?></span>
|
||||
<span class="aksrt-posts-navs__cat-count"><?php echo esc_html((string) $cat->count); ?></span>
|
||||
</a>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($tags)) : ?>
|
||||
<section class="aksrt-posts-navs__section">
|
||||
<h2 class="aksrt-posts-navs__heading"><?php esc_html_e('热门标签', 'aksrt'); ?></h2>
|
||||
<div class="aksrt-posts-navs__tags">
|
||||
<?php foreach ($tags as $tag) : ?>
|
||||
<a href="<?php echo esc_url(get_tag_link($tag->term_id)); ?>" class="aksrt-posts-navs__tag"><?php echo esc_html($tag->name); ?></a>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
if (function_exists('aksrt_archive_close_shell')) {
|
||||
aksrt_archive_close_shell(['has_sidebar' => false]);
|
||||
}
|
||||
|
||||
get_footer();
|
||||
Reference in new issue
Block a user