function sf_header_wrap($header_layout) { global $post, $sf_options; $page_classes = sf_page_classes(); $header_layout = $page_classes['header-layout']; $page_header_type = "standard"; if (is_page() && $post) { $page_header_type = sf_get_post_meta($post->ID, 'sf_page_header_type', true); } else { if (is_singular('post') && $post) { $post_header_type = sf_get_post_meta($post->ID, 'sf_page_header_type', true); $fw_media_display = sf_get_post_meta($post->ID, 'sf_fw_media_display', true); $page_title_style = sf_get_post_meta($post->ID, 'sf_page_title_style', true); if ($page_title_style == "fancy" || $fw_media_display == "fw-media-title" || $fw_media_display == "fw-media") { $page_header_type = $post_header_type; } } else { if (is_singular('portfolio') && $post) { $port_header_type = sf_get_post_meta($post->ID, 'sf_page_header_type', true); $fw_media_display = sf_get_post_meta($post->ID, 'sf_fw_media_display', true); $page_title = sf_get_post_meta($post->ID, 'sf_page_title', true); $page_title_style = sf_get_post_meta($post->ID, 'sf_page_title_style', true); if ($page_title_style == "fancy" || !$page_title) { $page_header_type = $port_header_type; } } } } $fullwidth_header = $sf_options['fullwidth_header']; $enable_tb = $sf_options['enable_tb']; $tb_left_config = $sf_options['tb_left_config']; $tb_right_config = $sf_options['tb_right_config']; $tb_left_text = __($sf_options['tb_left_text'], 'swiftframework'); $tb_right_text = __($sf_options['tb_right_text'], 'swiftframework'); $enable_sticky_tb = false; if (isset($sf_options['enable_sticky_topbar'])) { $enable_sticky_tb = $sf_options['enable_sticky_topbar']; } $header_left_config = __($sf_options['header_left_config'], 'swiftframework'); $header_right_config = __($sf_options['header_right_config'], 'swiftframework'); if (($page_header_type == "naked-light" || $page_header_type == "naked-dark") && ($header_layout == "header-vert" || $header_layout == "header-vert-right")) { $header_layout = apply_filters('sf_naked_default_header', "header-1"); $enable_tb = false; } $tb_left_output = $tb_right_output = ""; if ($tb_left_config == "social") { $tb_left_output .= do_shortcode('[social]') . "\n"; } else { if ($tb_left_config == "aux-links") { $tb_left_output .= sf_aux_links('tb-menu', true, 'header-1') . "\n"; } else { if ($tb_left_config == "menu") { $tb_left_output .= sf_top_bar_menu() . "\n"; } else { if ($tb_left_config == "cart-wishlist") { $tb_left_output .= '<div class="aux-item aux-cart-wishlist"><nav class="std-menu cart-wishlist"><ul class="menu">' . "\n"; $tb_left_output .= sf_get_cart(); $tb_left_output .= sf_get_wishlist(); $tb_left_output .= '</ul></nav></div>' . "\n"; } else { $tb_left_output .= '<div class="tb-text">' . do_shortcode($tb_left_text) . '</div>' . "\n"; } } } } if ($tb_right_config == "social") { $tb_right_output .= do_shortcode('[social]') . "\n"; } else { if ($tb_right_config == "aux-links") { $tb_right_output .= sf_aux_links('tb-menu', true, 'header-1') . "\n"; } else { if ($tb_right_config == "menu") { $tb_right_output .= sf_top_bar_menu() . "\n"; } else { if ($tb_right_config == "cart-wishlist") { $tb_right_output .= '<div class="aux-item aux-cart-wishlist"><nav class="std-menu cart-wishlist"><ul class="menu">' . "\n"; $tb_right_output .= sf_get_cart(); $tb_right_output .= sf_get_wishlist(); $tb_right_output .= '</ul></nav></div>' . "\n"; } else { $tb_right_output .= '<div class="tb-text">' . do_shortcode($tb_right_text) . '</div>' . "\n"; } } } } $top_bar_class = ""; if ($enable_sticky_tb) { $top_bar_class = "sticky-top-bar"; } ?> <?php if ($enable_tb) { ?> <!--// TOP BAR //--> <div id="top-bar" class="<?php echo $top_bar_class; ?> "> <?php if ($fullwidth_header) { ?> <div class="container fw-header"> <?php } else { ?> <div class="container"> <?php } ?> <div class="col-sm-6 tb-left"><?php echo $tb_left_output; ?> </div> <div class="col-sm-6 tb-right"><?php echo $tb_right_output; ?> </div> </div> </div> <?php } ?> <!--// HEADER //--> <div class="header-wrap <?php echo esc_attr($page_classes['header-wrap']); ?> page-header-<?php echo esc_attr($page_header_type); ?> "> <?php do_action('sf_before_header_section'); ?> <div id="header-section" class="<?php echo esc_attr($header_layout); ?> <?php echo esc_attr($page_classes['logo']); ?> "> <?php do_action('sf_header_section_start'); ?> <?php echo sf_header($header_layout); ?> <?php do_action('sf_header_section_end'); ?> </div> <?php do_action('sf_after_header_section'); ?> <?php // Overlay Menu if ($header_left_config == "overlay-menu" || $header_right_config == "overlay-menu") { echo sf_overlay_menu(); } ?> <?php // Contact Slideout if ($header_left_config == "contact" || $header_right_config == "contact") { echo sf_contact_slideout(); } ?> </div> <?php }
function sf_header_wrap($header_layout) { global $post, $sf_options; $header_wrap_class = $logo_class = ""; if (function_exists('sf_page_classes')) { $page_classes = sf_page_classes(); $header_layout = $page_classes['header-layout']; $header_wrap_class = $page_classes['header-wrap']; $logo_class = $page_classes['logo']; } $page_header_type = "standard"; if (is_page() && $post) { $page_header_type = sf_get_post_meta($post->ID, 'sf_page_header_type', true); } else { if (is_singular('post') && $post) { $post_header_type = sf_get_post_meta($post->ID, 'sf_page_header_type', true); $fw_media_display = sf_get_post_meta($post->ID, 'sf_fw_media_display', true); $page_title_style = sf_get_post_meta($post->ID, 'sf_page_title_style', true); if ($page_title_style == "fancy" || $fw_media_display == "fw-media-title" || $fw_media_display == "fw-media") { $page_header_type = $post_header_type; } } else { if (is_singular('portfolio') && $post) { $port_header_type = sf_get_post_meta($post->ID, 'sf_page_header_type', true); $fw_media_display = sf_get_post_meta($post->ID, 'sf_fw_media_display', true); $page_title = sf_get_post_meta($post->ID, 'sf_page_title', true); $page_title_style = sf_get_post_meta($post->ID, 'sf_page_title_style', true); if ($page_title_style == "fancy" || !$page_title) { $page_header_type = $port_header_type; } } } } $fullwidth_header = $sf_options['fullwidth_header']; $enable_mini_header = $sf_options['enable_mini_header']; $enable_tb = $sf_options['enable_tb']; $tb_left_config = $sf_options['tb_left_config']; $tb_right_config = $sf_options['tb_right_config']; $tb_left_text = esc_attr(__($sf_options['tb_left_text'], 'swiftframework')); $tb_right_text = esc_attr(__($sf_options['tb_right_text'], 'swiftframework')); $header_left_config = $sf_options['header_left_config']; $header_right_config = $sf_options['header_right_config']; if (($page_header_type == "naked-light" || $page_header_type == "naked-dark") && ($header_layout == "header-vert" || $header_layout == "header-vert-right")) { $header_layout = "header-4"; $enable_tb = false; } $tb_left_output = $tb_right_output = ""; if ($tb_left_config == "social") { $tb_left_output .= do_shortcode('[social]') . "\n"; } else { if ($tb_left_config == "account") { $tb_left_output .= sf_get_account() . "\n"; } else { if ($tb_left_config == "menu") { $tb_left_output .= sf_top_bar_menu() . "\n"; } else { $tb_left_output .= '<div class="tb-text">' . do_shortcode($tb_left_text) . '</div>' . "\n"; } } } if ($tb_right_config == "social") { $tb_right_output .= do_shortcode('[social]') . "\n"; } else { if ($tb_right_config == "account") { $tb_right_output .= sf_get_account() . "\n"; } else { if ($tb_right_config == "menu") { $tb_right_output .= sf_top_bar_menu() . "\n"; } else { $tb_right_output .= '<div class="tb-text">' . do_shortcode($tb_right_text) . '</div>' . "\n"; } } } ?> <?php if ($enable_tb) { ?> <!--// TOP BAR //--> <div id="top-bar"> <?php if ($fullwidth_header) { ?> <div class="container fw-header"> <?php } else { ?> <div class="container"> <?php } ?> <div class="col-sm-6 tb-left"><?php echo $tb_left_output; ?> </div> <div class="col-sm-6 tb-right"><?php echo $tb_right_output; ?> </div> </div> </div> <?php } ?> <!--// HEADER //--> <div class="header-wrap <?php echo esc_attr($header_wrap_class); ?> page-header-<?php echo esc_attr($page_header_type); ?> "> <div id="header-section" class="<?php echo esc_attr($header_layout); ?> <?php echo esc_attr($logo_class); ?> "> <?php if ($enable_mini_header) { echo sf_header($header_layout); } else { echo '<div class="sticky-wrapper">' . sf_header($header_layout) . '</div>'; } ?> </div> <?php // Fullscreen Search echo sf_fullscreen_search(); ?> <?php // Fullscreen Search if (isset($header_left_config) && array_key_exists('supersearch', $header_left_config['enabled']) || isset($header_right_config) && array_key_exists('supersearch', $header_right_config['enabled'])) { echo sf_fullscreen_supersearch(); } ?> <?php // Overlay Menu if (isset($header_left_config) && array_key_exists('overlay-menu', $header_left_config['enabled']) || isset($header_right_config) && array_key_exists('overlay-menu', $header_right_config['enabled'])) { echo sf_overlay_menu(); } ?> <?php // Contact Slideout if (isset($header_left_config) && array_key_exists('contact', $header_left_config['enabled']) || isset($header_right_config) && array_key_exists('contact', $header_right_config['enabled'])) { echo sf_contact_slideout(); } ?> </div> <?php }
function sf_header_wrap($header_layout) { global $post, $sf_options; $header_wrap_class = $logo_class = ""; if (function_exists('sf_page_classes')) { $page_classes = sf_page_classes(); $header_layout = $page_classes['header-layout']; $header_wrap_class = $page_classes['header-wrap']; $logo_class = $page_classes['logo']; } $page_header_type = "standard"; if (is_page() && $post) { $page_header_type = sf_get_post_meta($post->ID, 'sf_page_header_type', true); } else { if (is_singular('post') && $post) { $post_header_type = sf_get_post_meta($post->ID, 'sf_page_header_type', true); $fw_media_display = sf_get_post_meta($post->ID, 'sf_fw_media_display', true); $page_title_style = sf_get_post_meta($post->ID, 'sf_page_title_style', true); if ($page_title_style == "fancy" || $fw_media_display == "fw-media-title" || $fw_media_display == "fw-media") { $page_header_type = $post_header_type; } } else { if (is_singular('portfolio') && $post) { $port_header_type = sf_get_post_meta($post->ID, 'sf_page_header_type', true); $fw_media_display = sf_get_post_meta($post->ID, 'sf_fw_media_display', true); $page_title = sf_get_post_meta($post->ID, 'sf_page_title', true); $page_title_style = sf_get_post_meta($post->ID, 'sf_page_title_style', true); if ($page_title_style == "fancy" || !$page_title) { $page_header_type = $port_header_type; } } } } // Shop page check $shop_page = false; if (function_exists('is_shop') && is_shop() || function_exists('is_product_category') && is_product_category()) { $shop_page = true; } if ($shop_page) { if (isset($sf_options['woo_page_header'])) { $page_header_type = $sf_options['woo_page_header']; } } $fullwidth_header = $sf_options['fullwidth_header']; $enable_mini_header = $sf_options['enable_mini_header']; $enable_tb = $sf_options['enable_tb']; $enable_sticky_tb = false; if (isset($sf_options['enable_sticky_topbar'])) { $enable_sticky_tb = $sf_options['enable_sticky_topbar']; } $header_left_config = $sf_options['header_left_config']; $header_right_config = $sf_options['header_right_config']; if (($page_header_type == "naked-light" || $page_header_type == "naked-dark") && ($header_layout == "header-vert" || $header_layout == "header-vert-right")) { $header_layout = "header-4"; $enable_tb = false; } ?> <?php if ($enable_tb) { ?> <!--// TOP BAR //--> <?php echo sf_top_bar($enable_sticky_tb); ?> <?php } ?> <!--// HEADER //--> <div class="header-wrap <?php echo esc_attr($header_wrap_class); ?> page-header-<?php echo esc_attr($page_header_type); ?> "> <div id="header-section" class="<?php echo esc_attr($header_layout); ?> <?php echo esc_attr($logo_class); ?> "> <?php if ($enable_mini_header) { echo sf_header($header_layout); } else { echo '<div class="sticky-wrapper">' . sf_header($header_layout) . '</div>'; } ?> </div> <?php // Fullscreen Search echo sf_fullscreen_search(); ?> <?php // Fullscreen Search if (isset($header_left_config) && array_key_exists('supersearch', $header_left_config['enabled']) || isset($header_right_config) && array_key_exists('supersearch', $header_right_config['enabled'])) { echo sf_fullscreen_supersearch(); } ?> <?php // Overlay Menu if (isset($header_left_config) && array_key_exists('overlay-menu', $header_left_config['enabled']) || isset($header_right_config) && array_key_exists('overlay-menu', $header_right_config['enabled'])) { echo sf_overlay_menu(); } ?> <?php // Contact Slideout if (isset($header_left_config) && array_key_exists('contact', $header_left_config['enabled']) || isset($header_right_config) && array_key_exists('contact', $header_right_config['enabled'])) { echo sf_contact_slideout(); } ?> </div> <?php }