专用页对齐 content-shell,并删 page-header query-var 回退

archives/friends/newposts/posts-navs/categories 统一壳层与 page-header 契约,
主路径不再保留 aksrt_ph_* ambient 传参。
This commit is contained in:
2026-07-09 23:05:06 +08:00
parent 9fd0735e97
commit 8849540fda
6 changed files with 228 additions and 210 deletions
+7 -21
View File
@@ -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'] ?? '');