false, 'keywords' => [], 'categories' => [], 'type_options' => []]; $show_search = !empty($search_cfg['show']) || !empty($cfg['with_search']); $show_cards = !empty($settings['header_components_cards_enabled']); $icon_cards = isset($settings['header_components_icon_cards']) ? (array) $settings['header_components_icon_cards'] : []; $card_bg_mode = !empty($settings['header_components_card_shared_bg']) ? 'shared' : 'individual'; $card_blur = !empty($settings['header_components_card_blur']); $filter_blur_devices = isset($settings['header_components_filter_blur_devices']) ? (array) $settings['header_components_filter_blur_devices'] : ($card_blur ? ['pc', 'mobile'] : []); $card_show_devices = isset($settings['header_components_card_show_devices']) ? (array) $settings['header_components_card_show_devices'] : ['pc', 'mobile']; $card_icon_shape = $settings['header_components_card_icon_shape'] ?? 'circle'; $slide_count = count($hero_banners); $visible_card_count = ($show_cards && !empty($icon_cards)) ? count($icon_cards) : 0; $container_classes = ['header-slider-container', 'header-components-container', 'relative', 'mb20', 'card-' . $visible_card_count]; if (in_array('pc', $filter_blur_devices, true) || in_array('mobile', $filter_blur_devices, true)) { $container_classes[] = 'filter-blur'; } if (in_array('pc', $filter_blur_devices, true)) { $container_classes[] = 'has-blur-pc'; } if (in_array('mobile', $filter_blur_devices, true)) { $container_classes[] = 'has-blur-mobile'; } if (!in_array('pc', $card_show_devices, true)) { $container_classes[] = 'hide-cards-pc'; } if (!in_array('mobile', $card_show_devices, true)) { $container_classes[] = 'hide-cards-mobile'; } $search_placeholder = function_exists('aksrt_get_search_placeholder') ? aksrt_get_search_placeholder() : __('开启精彩搜索', 'aksrt'); $search_value = trim((string) get_search_query()); $search_type = function_exists('aksrt_get_search_form_type') ? aksrt_get_search_form_type() : 'post'; $render_hero_search = static function (string $search_id) use ($search_placeholder, $search_value, $search_type, $search_cfg): void { $_kw = $search_cfg['keywords'] ?? []; $_cats = $search_cfg['categories'] ?? []; $_types = $search_cfg['type_options'] ?? []; $_show_cat = !empty($search_cfg['show_input_cat']) && !empty($_cats); $_show_type = !empty($search_cfg['show_type']) && !empty($_types); ?>
$slider_cfg['effect'] ?? 'fade', 'loop' => $slide_count > 1 && ($slider_cfg['loop'] ?? true), 'speed' => 600, 'autoplay' => $slide_count > 1 ? ['delay' => ($slider_cfg['autoplay_interval'] ?? 5000), 'disableOnInteraction' => false] : false, 'keyboard' => ['enabled' => true], ]; if (!empty($slider_cfg['pagination'])) { $swiper_config['pagination'] = ['clickable' => true]; } if (!empty($slider_cfg['navigation'])) { $swiper_config['navigation'] = true; } $pc_height = $slider_cfg['pc_height'] ?? ''; $mobile_height = $slider_cfg['mobile_height'] ?? ''; $height_style = ''; if ($pc_height !== '') { $height_style .= '--pc-height:' . esc_attr($pc_height) . ';'; } if ($mobile_height !== '') { $height_style .= '--m-height:' . esc_attr($mobile_height) . ';'; } ?>