专用页对齐 content-shell,并删 page-header query-var 回退
archives/friends/newposts/posts-navs/categories 统一壳层与 page-header 契约, 主路径不再保留 aksrt_ph_* ambient 传参。
This commit is contained in:
@@ -12,57 +12,64 @@ defined('ABSPATH') || exit;
|
||||
|
||||
get_header();
|
||||
global $wpdb;
|
||||
|
||||
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' => 'archives',
|
||||
]);
|
||||
}
|
||||
?>
|
||||
<div class="content-main content-main--page content-main--archives">
|
||||
<?php
|
||||
get_template_part('templates/parts/page-header', null, [
|
||||
'title' => esc_html__('文章归档', 'aksrt'),
|
||||
]);
|
||||
?>
|
||||
|
||||
<main id="main-content" class="container page-content-default" tabindex="-1">
|
||||
<header class="page-header">
|
||||
<h1 class="entry-title"><?php esc_html_e('文章归档', 'aksrt'); ?></h1>
|
||||
</header>
|
||||
|
||||
<div class="content-wrap">
|
||||
<div class="content-layout content-layout--no-sidebar">
|
||||
<div class="content-layout__primary">
|
||||
<div class="aksrt-archives container">
|
||||
<?php
|
||||
$years = $wpdb->get_results(
|
||||
"SELECT DISTINCT YEAR(post_date) AS year, MONTH(post_date) AS month, COUNT(*) AS count
|
||||
FROM {$wpdb->posts}
|
||||
WHERE post_type = 'post' AND post_status = 'publish'
|
||||
GROUP BY YEAR(post_date), MONTH(post_date)
|
||||
ORDER BY year DESC, month DESC"
|
||||
); // phpcs:ignore WordPress.DB.DirectDatabaseQuery
|
||||
|
||||
$current_year = 0;
|
||||
foreach ($years as $row) :
|
||||
if ((int) $row->year !== $current_year) :
|
||||
$current_year = (int) $row->year;
|
||||
?>
|
||||
<h2 class="aksrt-archives__year"><?php echo esc_html($current_year); ?></h2>
|
||||
<?php endif; ?>
|
||||
<h3 class="aksrt-archives__month">
|
||||
<?php echo esc_html(sprintf('%d 月 (%d 篇)', (int) $row->month, (int) $row->count)); ?>
|
||||
</h3>
|
||||
<ul class="aksrt-archives__list">
|
||||
<?php
|
||||
$month_posts = get_posts([
|
||||
'year' => (int) $row->year,
|
||||
'monthnum' => (int) $row->month,
|
||||
'posts_per_page' => -1,
|
||||
'post_status' => 'publish',
|
||||
]);
|
||||
foreach ($month_posts as $mp) :
|
||||
?>
|
||||
<li class="aksrt-archives__item">
|
||||
<span class="aksrt-archives__date"><?php echo esc_html(get_the_date('m-d', $mp)); ?></span>
|
||||
<a href="<?php echo esc_url(get_permalink($mp->ID)); ?>" class="aksrt-archives__link"><?php echo esc_html($mp->post_title); ?></a>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
<div class="aksrt-archives">
|
||||
<?php
|
||||
$years = $wpdb->get_results(
|
||||
"SELECT DISTINCT YEAR(post_date) AS year, MONTH(post_date) AS month, COUNT(*) AS count
|
||||
FROM {$wpdb->posts}
|
||||
WHERE post_type = 'post' AND post_status = 'publish'
|
||||
GROUP BY YEAR(post_date), MONTH(post_date)
|
||||
ORDER BY year DESC, month DESC"
|
||||
); // phpcs:ignore WordPress.DB.DirectDatabaseQuery
|
||||
|
||||
$current_year = 0;
|
||||
foreach ($years as $row) :
|
||||
if ((int) $row->year !== $current_year) :
|
||||
$current_year = (int) $row->year;
|
||||
?>
|
||||
<h2 class="aksrt-archives__year"><?php echo esc_html((string) $current_year); ?></h2>
|
||||
<?php endif; ?>
|
||||
<h3 class="aksrt-archives__month">
|
||||
<?php echo esc_html(sprintf('%d 月 (%d 篇)', (int) $row->month, (int) $row->count)); ?>
|
||||
</h3>
|
||||
<ul class="aksrt-archives__list">
|
||||
<?php
|
||||
$month_posts = get_posts([
|
||||
'year' => (int) $row->year,
|
||||
'monthnum' => (int) $row->month,
|
||||
'posts_per_page' => -1,
|
||||
'post_status' => 'publish',
|
||||
]);
|
||||
foreach ($month_posts as $mp) :
|
||||
?>
|
||||
<li class="aksrt-archives__item">
|
||||
<span class="aksrt-archives__date"><?php echo esc_html(get_the_date('m-d', $mp)); ?></span>
|
||||
<a href="<?php echo esc_url(get_permalink($mp->ID)); ?>" class="aksrt-archives__link"><?php echo esc_html($mp->post_title); ?></a>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
if (function_exists('aksrt_archive_close_shell')) {
|
||||
aksrt_archive_close_shell(['has_sidebar' => false]);
|
||||
}
|
||||
|
||||
get_footer();
|
||||
|
||||
@@ -46,26 +46,31 @@ if ($page_title === '') {
|
||||
}
|
||||
?>
|
||||
|
||||
<main id="main-content" class="site-main content-shell" tabindex="-1">
|
||||
<?php if (function_exists('aksrt_breadcrumbs')) {
|
||||
aksrt_breadcrumbs();
|
||||
} ?>
|
||||
<?php
|
||||
if (function_exists('aksrt_archive_open_shell')) {
|
||||
aksrt_archive_open_shell([
|
||||
'main_class' => 'site-main container content-shell content-shell--page',
|
||||
'has_sidebar' => false,
|
||||
'page_kind' => 'categories',
|
||||
]);
|
||||
}
|
||||
?>
|
||||
<div class="content-main content-main--page content-main--categories">
|
||||
<?php if (function_exists('aksrt_breadcrumbs')) { aksrt_breadcrumbs(); } ?>
|
||||
<?php
|
||||
$cats_meta = sprintf(
|
||||
/* translators: 1: total category count, 2: total published post count */
|
||||
esc_html__('共 %1$d 个分类 · 共 %2$d 篇文章', 'aksrt'),
|
||||
$total_cats,
|
||||
$total_posts
|
||||
);
|
||||
get_template_part('templates/parts/page-header', null, [
|
||||
'title' => esc_html($page_title),
|
||||
'desc' => $cats_meta,
|
||||
]);
|
||||
?>
|
||||
|
||||
<header class="page-header aksrt-cats-header">
|
||||
<h1 class="entry-title"><?php echo esc_html($page_title); ?></h1>
|
||||
<p class="aksrt-cats-header__meta">
|
||||
<?php
|
||||
printf(
|
||||
/* translators: 1: total category count, 2: total published post count */
|
||||
esc_html__('共 %1$d 个分类 · 共 %2$d 篇文章', 'aksrt'),
|
||||
$total_cats,
|
||||
$total_posts
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
</header>
|
||||
|
||||
<?php if (!empty($top_level)) : ?>
|
||||
<?php if (!empty($top_level)) : ?>
|
||||
<section class="aksrt-cats-grid" aria-label="<?php esc_attr_e('分类列表', 'aksrt'); ?>">
|
||||
<?php foreach ($top_level as $cat) :
|
||||
$cat_id = (int) $cat->term_id;
|
||||
@@ -124,7 +129,11 @@ if ($page_title === '') {
|
||||
<?php esc_html_e('返回首页', 'aksrt'); ?>
|
||||
</a>
|
||||
</p>
|
||||
</main>
|
||||
|
||||
</div>
|
||||
<?php
|
||||
if (function_exists('aksrt_archive_close_shell')) {
|
||||
aksrt_archive_close_shell(['has_sidebar' => false]);
|
||||
}
|
||||
|
||||
get_footer();
|
||||
|
||||
@@ -11,51 +11,56 @@ defined('ABSPATH') || exit;
|
||||
get_header();
|
||||
|
||||
$links = function_exists('aksrt_get_friend_links') ? aksrt_get_friend_links() : [];
|
||||
|
||||
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' => 'friends',
|
||||
]);
|
||||
}
|
||||
?>
|
||||
<div class="content-main content-main--page content-main--friends">
|
||||
<?php
|
||||
get_template_part('templates/parts/page-header', null, [
|
||||
'title' => esc_html__('友情链接', 'aksrt'),
|
||||
'desc' => __('与这些优秀的站点交换友链', 'aksrt'),
|
||||
]);
|
||||
?>
|
||||
|
||||
<main id="main-content" class="container page-content-default" tabindex="-1">
|
||||
<header class="page-header">
|
||||
<h1 class="entry-title"><?php esc_html_e('友情链接', 'aksrt'); ?></h1>
|
||||
<p><?php esc_html_e('与这些优秀的站点交换友链', 'aksrt'); ?></p>
|
||||
</header>
|
||||
<?php if (!empty($links)) : ?>
|
||||
<div class="friends-grid">
|
||||
<?php foreach ($links as $link) : ?>
|
||||
<a class="friend-card" href="<?php echo esc_url($link['url'] ?? '#'); ?>" target="_blank" rel="noopener noreferrer">
|
||||
<?php
|
||||
$logo = $link['logo'] ?? '';
|
||||
if ($logo) {
|
||||
echo '<img class="friend-card__avatar" src="' . esc_url($logo) . '" alt="">';
|
||||
} else {
|
||||
$initial = function_exists('mb_substr') ? mb_substr((string) ($link['name'] ?? 'A'), 0, 1, 'UTF-8') : substr((string) ($link['name'] ?? 'A'), 0, 1);
|
||||
echo '<div class="friend-card__avatar" style="display:flex;align-items:center;justify-content:center;font-weight:800;color:var(--color-primary);font-family:var(--font-heading);">' . esc_html($initial) . '</div>';
|
||||
}
|
||||
?>
|
||||
<div class="friend-card__info">
|
||||
<h3 class="friend-card__name"><?php echo esc_html($link['name'] ?? ''); ?></h3>
|
||||
<p class="friend-card__desc"><?php echo esc_html($link['description'] ?? ''); ?></p>
|
||||
</div>
|
||||
</a>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php else : ?>
|
||||
<div class="no-results content-stream__empty">
|
||||
<p><?php esc_html_e('暂无友链,请在主题后台添加。', 'aksrt'); ?></p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="content-wrap">
|
||||
<div class="content-layout content-layout--no-sidebar">
|
||||
<div class="content-layout__primary">
|
||||
|
||||
<?php if (! empty($links)) : ?>
|
||||
<div class="friends-grid">
|
||||
<?php foreach ($links as $link) : ?>
|
||||
<a class="friend-card" href="<?php echo esc_url($link['url'] ?? '#'); ?>" target="_blank" rel="noopener noreferrer">
|
||||
<?php
|
||||
$logo = $link['logo'] ?? '';
|
||||
if ($logo) {
|
||||
echo '<img class="friend-card__avatar" src="' . esc_url($logo) . '" alt="">';
|
||||
} else {
|
||||
$initial = function_exists('mb_substr') ? mb_substr((string) ($link['name'] ?? 'A'), 0, 1, 'UTF-8') : substr((string) ($link['name'] ?? 'A'), 0, 1);
|
||||
echo '<div class="friend-card__avatar" style="display:flex;align-items:center;justify-content:center;font-weight:800;color:var(--color-primary);font-family:var(--font-heading);">' . esc_html($initial) . '</div>';
|
||||
}
|
||||
?>
|
||||
<div class="friend-card__info">
|
||||
<h3 class="friend-card__name"><?php echo esc_html($link['name'] ?? ''); ?></h3>
|
||||
<p class="friend-card__desc"><?php echo esc_html($link['description'] ?? ''); ?></p>
|
||||
<p class="text-center" style="margin-top:32px;">
|
||||
<a class="btn-outline" href="<?php echo esc_url(home_url('/')); ?>"><?php esc_html_e('返回首页', 'aksrt'); ?></a>
|
||||
</p>
|
||||
</div>
|
||||
</a>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php else : ?>
|
||||
<div class="no-results">
|
||||
<p><?php esc_html_e('暂无友链,请在主题后台添加。', 'aksrt'); ?></p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<p style="text-align:center;margin-top:32px;">
|
||||
<a class="btn-outline" href="<?php echo esc_url(home_url('/')); ?>"><?php esc_html_e('返回首页', 'aksrt'); ?></a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<?php
|
||||
if (function_exists('aksrt_archive_close_shell')) {
|
||||
aksrt_archive_close_shell(['has_sidebar' => false]);
|
||||
}
|
||||
|
||||
get_footer();
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
* Reusable Page Header Template Part.
|
||||
*
|
||||
* Contract: get_template_part(..., null, $args)
|
||||
* Prefer explicit $args over ambient query vars.
|
||||
*
|
||||
* Args:
|
||||
* style – '' | '1' | '2' | '3' | 'not'
|
||||
@@ -20,11 +19,8 @@ defined('ABSPATH') || exit;
|
||||
|
||||
$args = is_array($args ?? null) ? $args : [];
|
||||
|
||||
// Resolve style: explicit args > residual query var > global setting.
|
||||
// Resolve style: explicit args > global setting.
|
||||
$ph_style = array_key_exists('style', $args) ? $args['style'] : null;
|
||||
if ($ph_style === null) {
|
||||
$ph_style = get_query_var('aksrt_ph_style', null);
|
||||
}
|
||||
if ($ph_style === null) {
|
||||
$ph_style = class_exists('AKSRT_Settings')
|
||||
? (AKSRT_Settings::get_other_page_settings()['header_style'] ?? '1')
|
||||
@@ -39,23 +35,13 @@ if ($ph_style === '') {
|
||||
return;
|
||||
}
|
||||
|
||||
$ph_eyebrow = array_key_exists('eyebrow', $args)
|
||||
? (string) $args['eyebrow']
|
||||
: (string) get_query_var('aksrt_ph_eyebrow', '');
|
||||
$ph_title = array_key_exists('title', $args)
|
||||
? (string) $args['title']
|
||||
: (string) get_query_var('aksrt_ph_title', '');
|
||||
$ph_desc = array_key_exists('desc', $args)
|
||||
? (string) $args['desc']
|
||||
: (string) get_query_var('aksrt_ph_desc', '');
|
||||
$ph_extra = array_key_exists('extra', $args)
|
||||
? (string) $args['extra']
|
||||
: (string) get_query_var('aksrt_ph_extra', '');
|
||||
$ph_eyebrow = (string) ($args['eyebrow'] ?? '');
|
||||
$ph_title = (string) ($args['title'] ?? '');
|
||||
$ph_desc = (string) ($args['desc'] ?? '');
|
||||
$ph_extra = (string) ($args['extra'] ?? '');
|
||||
|
||||
// Cover image: explicit args > residual query var > global setting > post thumbnail.
|
||||
$ph_cover = array_key_exists('cover', $args)
|
||||
? (string) $args['cover']
|
||||
: (string) get_query_var('aksrt_ph_cover', '');
|
||||
// Cover image: explicit args > global setting > post thumbnail.
|
||||
$ph_cover = (string) ($args['cover'] ?? '');
|
||||
if ($ph_cover === '' && class_exists('AKSRT_Settings')) {
|
||||
$other = AKSRT_Settings::get_other_page_settings();
|
||||
$ph_cover = (string) ($other['header_cover_img'] ?? '');
|
||||
|
||||
Reference in New Issue
Block a user