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:
1 parent
3e3a4631f0
commit
bfb64211ee
12 files changed
+445
-285
No files matched your search
@@ -7,22 +7,8 @@
|
||||
*/
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
if (class_exists('AKSRT_Settings') && !AKSRT_Settings::homepage_module_hero_enabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Device visibility gate: header_components_device_visibility ('' = all, 'only_pc' = PC only, 'only_sm' = mobile only)
|
||||
$_hero_show_type = '';
|
||||
if (class_exists('AKSRT_Settings')) {
|
||||
$_hero_slider_cfg = AKSRT_Settings::get_header_components_settings();
|
||||
$_hero_show_type = $_hero_slider_cfg['show_type'] ?? '';
|
||||
}
|
||||
if ($_hero_show_type === 'only_pc' && wp_is_mobile()) {
|
||||
return;
|
||||
}
|
||||
if ($_hero_show_type === 'only_sm' && !wp_is_mobile()) {
|
||||
return;
|
||||
}
|
||||
// Visibility (page type + device) is decided by aksrt_header_slide_is_show().
|
||||
// This partial only renders content when already gated by aksrt_header_slide().
|
||||
|
||||
$cfg = get_query_var('aksrt_module_config', []);
|
||||
if (!is_array($cfg)) {
|
||||
@@ -171,6 +157,11 @@ $render_icon_cards = static function () use ($show_cards, $icon_cards, $card_bg_
|
||||
|
||||
if (!empty($hero_banners)) :
|
||||
$slider_cfg = function_exists('aksrt_get_slider_config') ? aksrt_get_slider_config() : [];
|
||||
$_nav_color_for_header = sanitize_hex_color((string) ($slider_cfg['nav_color'] ?? '')) ?: '';
|
||||
if ($_nav_color_for_header !== '' && strtolower($_nav_color_for_header) !== '#ffffff') {
|
||||
echo '<style id="aksrt-header-slider-nav-color">.header.show-slide{--header-color:' . esc_attr($_nav_color_for_header) . ';}</style>';
|
||||
}
|
||||
|
||||
$swiper_config = [
|
||||
'effect' => $slider_cfg['effect'] ?? 'fade',
|
||||
'loop' => $slide_count > 1 && ($slider_cfg['loop'] ?? true),
|
||||
|
||||
Reference in new issue
Block a user