feat(admin): rebuild page display settings
This commit is contained in:
@@ -48,7 +48,6 @@ if (!function_exists('aksrt_homepage_get_latest_query')) {
|
||||
return $query;
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('aksrt_homepage_get_tab_query')) {
|
||||
/**
|
||||
* Build a category-tab query.
|
||||
@@ -100,7 +99,6 @@ if (!function_exists('aksrt_homepage_get_tab_query')) {
|
||||
return $queries[$cache_key];
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('aksrt_homepage_has_active_sidebars')) {
|
||||
/**
|
||||
* Check whether any sidebar in the given stack is active.
|
||||
@@ -362,21 +360,3 @@ if (!function_exists('aksrt_homepage_render_posts_grid')) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('aksrt_homepage_render_section')) {
|
||||
/**
|
||||
* Render the remaining first-class homepage banner section.
|
||||
*
|
||||
* These are fixed homepage sections, not a freeform module canvas bridge.
|
||||
*/
|
||||
function aksrt_homepage_render_section(string $type): void {
|
||||
$type = sanitize_key($type);
|
||||
if ($type !== 'banner') {
|
||||
return;
|
||||
}
|
||||
|
||||
// Fixed homepage owns these sections directly.
|
||||
// Header slider is rendered by aksrt_header_slide(), never by this module path.
|
||||
get_template_part('templates/parts/home-modules/module', $type);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,6 @@ if (!function_exists('aksrt_header_slide_excluded_page_templates')) {
|
||||
'templates/pages/page-verify-email.php',
|
||||
'templates/pages/page-download.php',
|
||||
'templates/pages/page-download-file.php',
|
||||
'templates/pages/page-forums.php',
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -65,14 +64,6 @@ if (!function_exists('aksrt_header_slide_matches_query')) {
|
||||
return is_singular('post');
|
||||
case 'search':
|
||||
return is_search();
|
||||
case 'topics':
|
||||
return is_tax('topics');
|
||||
case 'forum_home':
|
||||
return is_page_template('templates/pages/page-forums.php');
|
||||
case 'forum_plate':
|
||||
return is_singular('plate') || is_post_type_archive('plate');
|
||||
case 'forum_post':
|
||||
return is_singular('forum_post');
|
||||
case 'page':
|
||||
if (!is_page()) {
|
||||
return false;
|
||||
|
||||
@@ -12,7 +12,7 @@ if (!function_exists('aksrt_homepage_render_layout')) {
|
||||
* Render the fixed homepage layout (Zibll latest-first content stream).
|
||||
*
|
||||
* Order (zibll-aligned):
|
||||
* fluid top → main.container → top content → banner → tabs/list → bottom content → sidebar
|
||||
* fluid top → main.container → top content → tabs/list → bottom content → sidebar
|
||||
* → fluid bottom. Hero/header-slider is rendered from header.php, not here.
|
||||
*/
|
||||
function aksrt_homepage_render_layout(): void {
|
||||
@@ -21,7 +21,6 @@ if (!function_exists('aksrt_homepage_render_layout')) {
|
||||
$tab_configs = $show_tabs ? aksrt_homepage_get_tab_configs() : [];
|
||||
$latest_contract = aksrt_homepage_get_latest_panel_contract();
|
||||
$view_mode = (($latest_contract['render_config_array']['mode'] ?? 'list') === 'card') ? 'card' : 'list';
|
||||
$banner_on = $show_tabs && aksrt_homepage_module_banner_enabled();
|
||||
$main_list_enabled = !class_exists('\AKSRT\Settings\Settings') || \AKSRT\Settings\Settings::home_posts_list_enabled();
|
||||
$list_title = class_exists('\AKSRT\Settings\Settings')
|
||||
? \AKSRT\Settings\Settings::home_list_title()
|
||||
@@ -42,9 +41,6 @@ if (!function_exists('aksrt_homepage_render_layout')) {
|
||||
'aksrt-homepage__content-zone aksrt-homepage__content-zone--top'
|
||||
);
|
||||
|
||||
if ($banner_on && function_exists('aksrt_homepage_render_section')) {
|
||||
aksrt_homepage_render_section('banner');
|
||||
}
|
||||
?>
|
||||
|
||||
<?php if ($main_list_enabled) : ?>
|
||||
@@ -54,7 +50,7 @@ if (!function_exists('aksrt_homepage_render_layout')) {
|
||||
<ul class="list-inline scroll-x no-scrollbar aksrt-homepage__tab-list" role="tablist" data-aksrt-home-tabs style="width:100%;">
|
||||
<li class="aksrt-homepage__tab-item is-active" role="presentation">
|
||||
<button type="button" class="aksrt-homepage__tab-button" role="tab" aria-selected="true" data-home-tab-target="latest">
|
||||
<?php echo esc_html($list_title !== '' ? $list_title : __('最新发布', 'aksrt')); ?>
|
||||
<?php echo wp_kses_post($list_title !== '' ? $list_title : __('最新发布', 'aksrt')); ?>
|
||||
</button>
|
||||
</li>
|
||||
<?php foreach ($tab_configs as $tab_cfg) : ?>
|
||||
@@ -67,7 +63,7 @@ if (!function_exists('aksrt_homepage_render_layout')) {
|
||||
data-home-tab-target="term-<?php echo (int) $tab_cfg['term_id']; ?>"
|
||||
data-tab-orderby="<?php echo esc_attr($tab_cfg['orderby']); ?>"
|
||||
>
|
||||
<?php echo esc_html($tab_cfg['title']); ?>
|
||||
<?php echo wp_kses_post($tab_cfg['title']); ?>
|
||||
</button>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
@@ -77,7 +73,7 @@ if (!function_exists('aksrt_homepage_render_layout')) {
|
||||
<?php elseif ($current_page > 1) : ?>
|
||||
<div class="box-body notop nobottom aksrt-homepage__titlebox">
|
||||
<div class="title-theme">
|
||||
<?php echo esc_html($list_title !== '' ? $list_title : __('最新发布', 'aksrt')); ?>
|
||||
<?php echo wp_kses_post($list_title !== '' ? $list_title : __('最新发布', 'aksrt')); ?>
|
||||
<small class="aksrt-homepage__page-indicator ml10">
|
||||
<?php echo esc_html(sprintf(__('第 %d 页', 'aksrt'), $current_page)); ?>
|
||||
</small>
|
||||
@@ -85,7 +81,7 @@ if (!function_exists('aksrt_homepage_render_layout')) {
|
||||
</div>
|
||||
<?php elseif ($list_title !== '') : ?>
|
||||
<div class="box-body notop nobottom aksrt-homepage__titlebox">
|
||||
<div class="title-theme"><?php echo esc_html($list_title); ?></div>
|
||||
<div class="title-theme"><?php echo wp_kses_post($list_title); ?></div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user