fix(header): wire multi-function page-type enable like zibll
Connect header_components_show_on through aksrt_header_slide_is_show with zibll page-type matching, drop the homepage-only gate, align admin options, apply nav color, enqueue by is_show, remove dead float-btn schema, and consume footer_tabbar_single extend mode on post singles.
This commit is contained in:
+27
-16
@@ -471,27 +471,38 @@ if ($floating_enabled) :
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($tabbar_enabled) : ?>
|
||||
<?php if ($tabbar_enabled) :
|
||||
$tabbar_use_single_extend = function_exists('aksrt_should_use_footer_tabbar_single_extend')
|
||||
&& aksrt_should_use_footer_tabbar_single_extend();
|
||||
?>
|
||||
<div class="footer-tabbar-placeholder" aria-hidden="true"></div>
|
||||
<nav id="footer-tabbar" class="footer-tabbar<?php echo !empty($tabbar_settings['animation']) ? ' has-animation' : ''; ?><?php echo !empty($tabbar_settings['scroll_down_hide']) ? ' scroll-down-hide' : ''; ?><?php echo empty($tabbar_settings['border']) ? ' no-border' : ''; ?><?php echo empty($tabbar_settings['shadow']) ? ' no-shadow' : ''; ?>" aria-label="<?php esc_attr_e('底部导航', 'aksrt'); ?>">
|
||||
<?php foreach ($tabbar_items as $tab_item) :
|
||||
$tab_type = sanitize_key((string) ($tab_item['type'] ?? 'custom'));
|
||||
$tab_text = (string) ($tab_item['text'] ?? '');
|
||||
$tab_icon = (string) ($tab_item['icon'] ?? 'fas fa-circle');
|
||||
$tab_href = home_url('/');
|
||||
if ($tab_type === 'category') {
|
||||
$tab_href = get_post_type_archive_link('post') ?: home_url('/');
|
||||
} elseif ($tab_type === 'auth') {
|
||||
$tab_href = is_user_logged_in() ? aksrt_get_user_center_url() : aksrt_get_login_url();
|
||||
} elseif ($tab_type === 'search') {
|
||||
$tab_href = home_url('/');
|
||||
}
|
||||
?>
|
||||
<nav id="footer-tabbar" class="footer-tabbar<?php echo !empty($tabbar_settings['animation']) ? ' has-animation' : ''; ?><?php echo !empty($tabbar_settings['scroll_down_hide']) ? ' scroll-down-hide' : ''; ?><?php echo empty($tabbar_settings['border']) ? ' no-border' : ''; ?><?php echo empty($tabbar_settings['shadow']) ? ' no-shadow' : ''; ?><?php echo $tabbar_use_single_extend ? ' footer-tabbar--single-extend' : ''; ?>" aria-label="<?php esc_attr_e('底部导航', 'aksrt'); ?>">
|
||||
<?php if ($tabbar_use_single_extend && function_exists('aksrt_render_footer_tabbar_single_extend')) :
|
||||
aksrt_render_footer_tabbar_single_extend(!empty($tabbar_settings['show_text']));
|
||||
else :
|
||||
foreach ($tabbar_items as $tab_item) :
|
||||
$tab_type = sanitize_key((string) ($tab_item['type'] ?? 'custom'));
|
||||
$tab_text = (string) ($tab_item['text'] ?? '');
|
||||
$tab_icon = (string) ($tab_item['icon'] ?? 'fas fa-circle');
|
||||
$tab_href = home_url('/');
|
||||
if ($tab_type === 'category') {
|
||||
$tab_href = get_post_type_archive_link('post') ?: home_url('/');
|
||||
} elseif ($tab_type === 'auth') {
|
||||
$tab_href = is_user_logged_in() ? aksrt_get_user_center_url() : aksrt_get_login_url();
|
||||
} elseif ($tab_type === 'search') {
|
||||
$tab_href = home_url('/');
|
||||
} elseif ($tab_type === 'custom' && !empty($tab_item['link'])) {
|
||||
$tab_href = (string) $tab_item['link'];
|
||||
} elseif ($tab_type === 'home') {
|
||||
$tab_href = home_url('/');
|
||||
}
|
||||
?>
|
||||
<a href="<?php echo esc_url($tab_href); ?>" class="tabbar-item" data-type="<?php echo esc_attr($tab_type); ?>">
|
||||
<i class="<?php echo esc_attr($tab_icon); ?>" aria-hidden="true"></i>
|
||||
<?php if (!empty($tabbar_settings['show_text'])) : ?><span><?php echo esc_html($tab_text); ?></span><?php endif; ?>
|
||||
</a>
|
||||
<?php endforeach; ?>
|
||||
<?php endforeach;
|
||||
endif; ?>
|
||||
</nav>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user