专用页对齐 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
@@ -14,7 +14,6 @@ get_header();
|
||||
|
||||
$paged = max(1, (int) get_query_var('paged'));
|
||||
$per_page = 20;
|
||||
|
||||
$query = new WP_Query([
|
||||
'post_type' => 'post',
|
||||
'post_status' => 'publish',
|
||||
@@ -23,45 +22,51 @@ $query = new WP_Query([
|
||||
'orderby' => 'date',
|
||||
'order' => 'DESC',
|
||||
]);
|
||||
|
||||
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' => 'newposts',
|
||||
]);
|
||||
}
|
||||
?>
|
||||
<div class="content-main content-main--page content-main--newposts">
|
||||
<?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-newposts container">
|
||||
<?php if ($query->have_posts()) : ?>
|
||||
<div class="aksrt-newposts__list">
|
||||
<?php while ($query->have_posts()) : $query->the_post(); ?>
|
||||
<article class="aksrt-newposts__item">
|
||||
<span class="aksrt-newposts__date"><?php echo esc_html(get_the_date()); ?></span>
|
||||
<h3 class="aksrt-newposts__title">
|
||||
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
|
||||
</h3>
|
||||
<p class="aksrt-newposts__excerpt"><?php echo esc_html(wp_trim_words(get_the_excerpt(), 30)); ?></p>
|
||||
</article>
|
||||
<?php endwhile; ?>
|
||||
</div>
|
||||
<?php
|
||||
if (function_exists('aksrt_render_pagination')) {
|
||||
aksrt_render_pagination($query);
|
||||
} else {
|
||||
echo '<div class="aksrt-pagination">' . paginate_links(['total' => $query->max_num_pages]) . '</div>';
|
||||
}
|
||||
?>
|
||||
<?php wp_reset_postdata(); ?>
|
||||
<?php else : ?>
|
||||
<p class="aksrt-newposts__empty"><?php esc_html_e('暂无文章。', 'aksrt'); ?></p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<div class="aksrt-newposts">
|
||||
<?php if ($query->have_posts()) : ?>
|
||||
<div class="aksrt-newposts__list">
|
||||
<?php while ($query->have_posts()) : $query->the_post(); ?>
|
||||
<article class="aksrt-newposts__item">
|
||||
<span class="aksrt-newposts__date"><?php echo esc_html(get_the_date()); ?></span>
|
||||
<h3 class="aksrt-newposts__title">
|
||||
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
|
||||
</h3>
|
||||
<p class="aksrt-newposts__excerpt"><?php echo esc_html(wp_trim_words(get_the_excerpt(), 30)); ?></p>
|
||||
</article>
|
||||
<?php endwhile; ?>
|
||||
</div>
|
||||
<?php
|
||||
if (function_exists('aksrt_render_pagination')) {
|
||||
aksrt_render_pagination($query);
|
||||
} else {
|
||||
echo '<div class="aksrt-pagination">' . paginate_links(['total' => $query->max_num_pages]) . '</div>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
}
|
||||
wp_reset_postdata();
|
||||
?>
|
||||
<?php else : ?>
|
||||
<p class="aksrt-newposts__empty content-stream__empty"><?php esc_html_e('暂无文章。', 'aksrt'); ?></p>
|
||||
<?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