header.php 6.28 KB
<?php
/**
 * The header for our theme.
 *
 * Displays all of the <head> section and everything up till <div id="content">
 *
 * @package storefront
 */
?>
<!DOCTYPE html>
<html <?php language_attributes(); ?> <?php storefront_html_tag_schema(); ?>>
    <head>

        <meta charset="<?php bloginfo('charset'); ?>">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
        <link rel="profile" href="http://gmpg.org/xfn/11">
        <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>">


        <?php
        $post = $wp_query->post;
        $post_type = $post->post_type;
        ?>
        <meta property="og:url" content="<?php echo ($post_type == 'post') ? $_SERVER['REQUEST_URI'] : get_site_url(); ?>"/>
        <meta property="og:title" content="<?php echo ($post_type == 'post') ? $post->post_title : 'REIZE'; ?>"/>
        <meta property="og:image" content="<?php echo ($post_type == 'post') ? wp_get_attachment_image_src(get_post_thumbnail_id($post), 'thumbnail', false)[0] : get_site_url() . '/wp-content/themes/reize/assets/images/Hero_Shot_small.jpg'; ?>"/>
        <meta property="og:description" content="REIZE is the worlds most versatile energy drink, home delivered for as low as 62c per drink. It's sugar free, it's lightweight and it's Most Flavoursome. Caffeine, Taurine and Ginseng combines to give an amazing energy boost. Try it today!"/>
        <link rel="shortcut icon" type="image/x-icon" href="<?php echo get_stylesheet_directory_uri(); ?>/favicon.ico">
        <link rel="apple-touch-icon" href="<?php echo get_stylesheet_directory_uri(); ?>/favicon.ico">

        <?php wp_head(); ?>

        <!---->
        <script type="text/javascript">
            currentsite = '<?php echo get_site_url(); ?>';

            var fgc_current_page = '';
<?php
$fgc_string_url = $_SERVER['REQUEST_URI'];
if ($fgc_string_url === '/') {
    ?>
                fgc_current_page = 'home-page';
<?php }
?>
        </script>

        <script type="text/javascript">
            jQuery(document).ready(function () {
                var pro = ('https:' === document.location.protocol) ? 'https:' : 'http:';
                if (pro === 'https:')
                    jQuery("img").each(function () {
                        strURL = jQuery(this).prop('src').replace('http:', 'https:');
                        jQuery(this).attr('src', strURL);
                    });
//$("script[src='en.js']").remove();
//                jQuery("script").each(function () {
//                    $src = jQuery(this).attr('src');
//                    if (typeof $src !== 'undefined') {
//                        if ($src.indexOf('jquery.payment.min.js') !== -1) {
//                            jQuery("script[src='" + $src + "']").remove();
//                        }
//                    }
//                });
            });

        </script>

        <!--script src="https://cdn.optimizely.com/js/8128751993.js"></script-->

        <script>
            ga('create', '<?php echo get_option("woocommerce_google_analytics_ga_id"); ?>', 'auto');

        </script>
    </head>

    <body <?php body_class(); ?> >
        <input type="hidden" id="refresh" value="no">
        <?php
        if (function_exists('gtm4wp_the_gtm_tag') && $_SERVER['HTTP_HOST'] != 'reize.sydneyecommerce.com.au') {
            gtm4wp_the_gtm_tag();
        }
        ?>
        <div id="page" class="hfeed site <?php echo isset($_REQUEST['openlogin']) ? "openlogin" : ''; ?>">
            <div id="sidebar-wrapper">
                <div class="menu" id="tvmenu-mobile">
                    <nav id="site-navigation" class="main-navigation">
                        <div class="menu_title">Menu</div>
                        <?php
                        wp_nav_menu(
                                array(
                                    'theme_location' => 'primary',
                                    'container_class' => 'primary-mobile-navigation',
                                )
                        );
                        wp_nav_menu(
                                array(
                                    'theme_location' => 'handheld',
                                    'container_class' => 'handheld-navigation',
                                )
                        );
                        echo '<div class="subscribe-and-connect-connect tvmenumobile-subscribe">';
                        subscribe_and_connect_connect();
                        echo '</div>';
                        ?>
                    </nav>
                </div>
            </div>
            <div class="tvinner">
                <?php do_action('storefront_before_header'); ?>

                <header id="masthead" class="site-header" role="banner" <?php
                if (get_header_image() != '') {
                    echo 'style="background-image: url(' . esc_url(get_header_image()) . ');"';
                } else {
                    // echo 'style="background-image: url('.'/wp-content/uploads/2016/03/logo.png'.');"';
                }
                ?>>
                    <div class="col-full">

                        <?php
                        /**
                         * @hooked storefront_skip_links - 0
                         * @hooked storefront_social_icons - 10
                         * @hooked storefront_site_branding - 20
                         * @hooked storefront_secondary_navigation - 30
                         * @hooked storefront_product_search - 40
                         * @hooked storefront_primary_navigation - 50
                         * @hooked storefront_header_cart - 60
                         */
                        do_action('storefront_header');
                        ?>

                    </div>
                </header><!-- #masthead -->

                <?php
                /**
                 * @hooked storefront_header_widget_region - 10
                 */
                do_action('storefront_before_content');
                ?>

                <div id="content" class="site-content" tabindex="-1">
                    <div class="col-full">

                        <?php
                        /**
                         * @hooked woocommerce_breadcrumb - 10
                         */
                        do_action('storefront_content_top');
                        ?>