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-components-container', 'relative', 'card-' . $visible_card_count]; 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); ?>