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 
    }
Пример #2
0
    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 
    }