Advertisement
SRD75

header.php

Nov 5th, 2017
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 14.23 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <!--[if IE 6]>
  3. <html id="ie6" <?php language_attributes(); ?>>
  4. <![endif]-->
  5. <!--[if IE 7]>
  6. <html id="ie7" <?php language_attributes(); ?>>
  7. <![endif]-->
  8. <!--[if IE 8]>
  9. <html id="ie8" <?php language_attributes(); ?>>
  10. <![endif]-->
  11. <!--[if !(IE 6) | !(IE 7) | !(IE 8)  ]><!-->
  12. <html <?php language_attributes(); ?>>
  13. <!--<![endif]-->
  14. <head>
  15.     <meta charset="<?php bloginfo( 'charset' ); ?>" />
  16.     <?php elegant_description(); ?>
  17.     <?php elegant_keywords(); ?>
  18.     <?php elegant_canonical(); ?>
  19.  
  20.     <?php do_action( 'et_head_meta' ); ?>
  21.  
  22.     <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
  23.  
  24.     <?php $template_directory_uri = get_template_directory_uri(); ?>
  25.     <!--[if lt IE 9]>
  26.     <script src="<?php echo esc_url( $template_directory_uri . '/js/html5.js"' ); ?>" type="text/javascript"></script>
  27.     <![endif]-->
  28.  
  29.     <script type="text/javascript">
  30.         document.documentElement.className = 'js';
  31.     </script>
  32.    
  33.     <!-- Google Tag Manager -->
  34.     <noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-PXXGTF"
  35.     height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
  36.     <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
  37.     new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
  38.     j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
  39.     '//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
  40.     })(window,document,'script','dataLayer','GTM-PXXGTF');</script>
  41.     <!-- End Google Tag Manager -->
  42.  
  43.     <?php wp_head(); ?>
  44.    
  45. </head>
  46. <body <?php body_class(); ?>>
  47.  
  48.     <div id="fb-root"></div>
  49.     <script>(function(d, s, id) {
  50.       var js, fjs = d.getElementsByTagName(s)[0];
  51.       if (d.getElementById(id)) return;
  52.       js = d.createElement(s); js.id = id;
  53.       js.src = "//connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v2.7&appId=171705736232531";
  54.       fjs.parentNode.insertBefore(js, fjs);
  55.     }(document, 'script', 'facebook-jssdk'));</script>
  56.    
  57. <?php if(is_front_page) { ?>
  58. <!--<script type="text/javascript">
  59. //jQuery is required to run this code
  60. jQuery( document ).ready(function() {
  61.  
  62.     scaleVideoContainer();
  63.  
  64.     initBannerVideoSize('.video-container .poster img');
  65.     initBannerVideoSize('.video-container .filter');
  66.     initBannerVideoSize('.video-container video');
  67.  
  68.     jQuery(window).on('resize', function() {
  69.         scaleVideoContainer();
  70.         scaleBannerVideoSize('.video-container .poster img');
  71.         scaleBannerVideoSize('.video-container .filter');
  72.         scaleBannerVideoSize('.video-container video');
  73.     });
  74.  
  75. });
  76.  
  77. function scaleVideoContainer() {
  78.  
  79.     var height = jQuery(window).height() + 5;
  80.     var unitHeight = parseInt(height) + 'px';
  81.     jQuery('.homepage-hero-module').css('height',unitHeight);
  82.  
  83. }
  84.  
  85. function initBannerVideoSize(element){
  86.  
  87.     jQuery(element).each(function(){
  88.         jQuery(this).data('height', jQuery(this).height());
  89.         jQuery(this).data('width', jQuery(this).width());
  90.     });
  91.  
  92.     scaleBannerVideoSize(element);
  93.  
  94. }
  95.  
  96. function scaleBannerVideoSize(element){
  97.  
  98.     var windowWidth = jQuery(window).width(),
  99.     windowHeight = jQuery(window).height() + 5,
  100.     videoWidth,
  101.     videoHeight;
  102.  
  103.     console.log(windowHeight);
  104.  
  105.     jQuery(element).each(function(){
  106.         var videoAspectRatio = jQuery(this).data('height')/jQuery(this).data('width');
  107.  
  108.         jQuery(this).width(windowWidth);
  109.  
  110.         if(windowWidth < 1000){
  111.             videoHeight = windowHeight;
  112.             videoWidth = videoHeight / videoAspectRatio;
  113.             jQuery(this).css({'margin-top' : 0, 'margin-left' : -(videoWidth - windowWidth) / 2 + 'px'});
  114.  
  115.             jQuery(this).width(videoWidth).height(videoHeight);
  116.         }
  117.  
  118.         jQuery('.homepage-hero-module .video-container video').addClass('fadeIn animated');
  119.  
  120.     });
  121. }
  122. </script>-->
  123. <? } ?>
  124.  
  125.     <?php if(is_front_page()) { ?>
  126.     <div style="background-color: #ED8F5B; text-align: center;" id="hellobar"><a href="/l/47-ways-to-promote-your-website/" title="9 website mistakes to avoid"><img src="/wp-content/uploads/2017/09/47-Ways-to-Promote-Your-Website-banner.png" title="9 website mistakes to avoid" alt="9 website mistakes to avoid" border="0" height="96px" width="auto" /></a></div>
  127.     <?php } ?>
  128.  
  129.     <div id="page-container">
  130.            
  131.         <?php
  132.             if ( is_page_template( 'page-template-blank.php' ) ) {
  133.                 return;
  134.             }
  135.        
  136.             $et_secondary_nav_items = et_divi_get_top_nav_items();
  137.        
  138.             $et_phone_number = $et_secondary_nav_items->phone_number;
  139.        
  140.             $et_email = $et_secondary_nav_items->email;
  141.        
  142.             $et_contact_info_defined = $et_secondary_nav_items->contact_info_defined;
  143.        
  144.             $show_header_social_icons = $et_secondary_nav_items->show_header_social_icons;
  145.        
  146.             $et_secondary_nav = $et_secondary_nav_items->secondary_nav;
  147.        
  148.             $et_top_info_defined = $et_secondary_nav_items->top_info_defined;
  149.        
  150.             $et_slide_header = 'slide' === et_get_option( 'header_style', 'left' ) || 'fullscreen' === et_get_option( 'header_style', 'left' ) ? true : false;
  151.         ?>
  152.  
  153.     <?php if ( $et_top_info_defined && ! $et_slide_header || is_customize_preview() ) : ?>
  154.         <div id="top-header"<?php echo $et_top_info_defined ? '' : 'style="display: none;"'; ?>>
  155.             <div class="container clearfix">
  156.  
  157.             <?php if ( $et_contact_info_defined ) : ?>
  158.  
  159.                 <div id="et-info">
  160.                 <?php if ( '' !== ( $et_phone_number = et_get_option( 'phone_number' ) ) ) : ?>
  161.                     <span id="et-info-phone"><a href="tel:<?php echo et_sanitize_html_input_text( $et_phone_number ); ?>"><?php echo et_sanitize_html_input_text( $et_phone_number ); ?></a></span>
  162.                 <?php endif; ?>
  163.  
  164.                 <?php if ( '' !== ( $et_email = et_get_option( 'header_email' ) ) ) : ?>
  165.                     <a href="<?php echo esc_attr( 'mailto:' . $et_email ); ?>"><span id="et-info-email"><?php echo esc_html( $et_email ); ?></span></a>
  166.                 <?php endif; ?>
  167.  
  168.                 <?php
  169.                 if ( true === $show_header_social_icons ) {
  170.                     get_template_part( 'includes/social_icons', 'header' );
  171.                 } ?>
  172.                 </div> <!-- #et-info -->
  173.  
  174.             <?php endif; // true === $et_contact_info_defined ?>
  175.  
  176.                 <div id="et-secondary-menu">
  177.                 <?php
  178.                     if ( ! $et_contact_info_defined && true === $show_header_social_icons ) {
  179.                         get_template_part( 'includes/social_icons', 'header' );
  180.                     } else if ( $et_contact_info_defined && true === $show_header_social_icons ) {
  181.                         ob_start();
  182.  
  183.                         get_template_part( 'includes/social_icons', 'header' );
  184.  
  185.                         $duplicate_social_icons = ob_get_contents();
  186.  
  187.                         ob_end_clean();
  188.  
  189.                         printf(
  190.                             '<div class="et_duplicate_social_icons">
  191.                                 %1$s
  192.                             </div>',
  193.                             $duplicate_social_icons
  194.                         );
  195.                     }
  196.  
  197.                     if ( '' !== $et_secondary_nav ) {
  198.                         echo $et_secondary_nav;
  199.                     }
  200.  
  201.                     et_show_cart_total();
  202.                 ?>
  203.                 </div> <!-- #et-secondary-menu -->
  204.  
  205.             </div> <!-- .container -->
  206.         </div> <!-- #top-header -->
  207.     <?php endif; // true ==== $et_top_info_defined ?>
  208.  
  209.     <?php if ( $et_slide_header || is_customize_preview() ) : ?>
  210.         <div class="et_slide_in_menu_container">
  211.             <?php if ( 'fullscreen' === et_get_option( 'header_style', 'left' ) || is_customize_preview() ) { ?>
  212.                 <span class="mobile_menu_bar et_toggle_fullscreen_menu"></span>
  213.             <?php } ?>
  214.  
  215.             <?php
  216.                 if ( $et_contact_info_defined || true === $show_header_social_icons || false !== et_get_option( 'show_search_icon', true ) || class_exists( 'woocommerce' ) || is_customize_preview() ) { ?>
  217.                     <div class="et_slide_menu_top">
  218.  
  219.                     <?php if ( 'fullscreen' === et_get_option( 'header_style', 'left' ) ) { ?>
  220.                         <div class="et_pb_top_menu_inner">
  221.                     <?php } ?>
  222.             <?php }
  223.  
  224.                 if ( true === $show_header_social_icons ) {
  225.                     get_template_part( 'includes/social_icons', 'header' );
  226.                 }
  227.  
  228.                 et_show_cart_total();
  229.             ?>
  230.             <?php if ( false !== et_get_option( 'show_search_icon', true ) || is_customize_preview() ) : ?>
  231.                 <?php if ( 'fullscreen' !== et_get_option( 'header_style', 'left' ) ) { ?>
  232.                     <div class="clear"></div>
  233.                 <?php } ?>
  234.                 <form role="search" method="get" class="et-search-form" action="<?php echo esc_url( home_url( '/' ) ); ?>">
  235.                     <?php
  236.                         printf( '<input type="search" class="et-search-field" placeholder="%1$s" placeholder="%2$s" name="s" title="%3$s" />',
  237.                             esc_attr__( 'Search &hellip;', 'Divi' ),
  238.                             get_search_query(),
  239.                             esc_attr__( 'Search for:', 'Divi' )
  240.                         );
  241.                     ?>
  242.                     <button type="submit" id="searchsubmit_header"></button>
  243.                 </form>
  244.             <?php endif; // true === et_get_option( 'show_search_icon', false ) ?>
  245.  
  246.             <?php if ( $et_contact_info_defined ) : ?>
  247.  
  248.                 <div id="et-info">
  249.                 <?php if ( '' !== ( $et_phone_number = et_get_option( 'phone_number' ) ) ) : ?>
  250.                     <span id="et-info-phone"><?php echo et_sanitize_html_input_text( $et_phone_number ); ?></span>
  251.                 <?php endif; ?>
  252.  
  253.                 <?php if ( '' !== ( $et_email = et_get_option( 'header_email' ) ) ) : ?>
  254.                     <a href="<?php echo esc_attr( 'mailto:' . $et_email ); ?>"><span id="et-info-email"><?php echo esc_html( $et_email ); ?></span></a>
  255.                 <?php endif; ?>
  256.                 </div> <!-- #et-info -->
  257.  
  258.             <?php endif; // true === $et_contact_info_defined ?>
  259.             <?php if ( $et_contact_info_defined || true === $show_header_social_icons || false !== et_get_option( 'show_search_icon', true ) || class_exists( 'woocommerce' ) || is_customize_preview() ) { ?>
  260.                 <?php if ( 'fullscreen' === et_get_option( 'header_style', 'left' ) ) { ?>
  261.                     </div> <!-- .et_pb_top_menu_inner -->
  262.                 <?php } ?>
  263.  
  264.                 </div> <!-- .et_slide_menu_top -->
  265.             <?php } ?>
  266.  
  267.             <div class="et_pb_fullscreen_nav_container">
  268.                 <?php
  269.                     $slide_nav = '';
  270.                     $slide_menu_class = 'et_mobile_menu';
  271.  
  272.                     $slide_nav = wp_nav_menu( array( 'theme_location' => 'primary-menu', 'container' => '', 'fallback_cb' => '', 'echo' => false, 'items_wrap' => '%3$s' ) );
  273.                     $slide_nav .= wp_nav_menu( array( 'theme_location' => 'secondary-menu', 'container' => '', 'fallback_cb' => '', 'echo' => false, 'items_wrap' => '%3$s' ) );
  274.                 ?>
  275.  
  276.                 <ul id="mobile_menu_slide" class="<?php echo esc_attr( $slide_menu_class ); ?>">
  277.  
  278.                 <?php
  279.                     if ( '' == $slide_nav ) :
  280.                 ?>
  281.                         <?php if ( 'on' == et_get_option( 'divi_home_link' ) ) { ?>
  282.                             <li <?php if ( is_home() ) echo( 'class="current_page_item"' ); ?>><a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php esc_html_e( 'Home', 'Divi' ); ?></a></li>
  283.                         <?php }; ?>
  284.  
  285.                         <?php show_page_menu( $slide_menu_class, false, false ); ?>
  286.                         <?php show_categories_menu( $slide_menu_class, false ); ?>
  287.                 <?php
  288.                     else :
  289.                         echo( $slide_nav );
  290.                     endif;
  291.                 ?>
  292.  
  293.                 </ul>
  294.             </div>
  295.         </div>
  296.     <?php endif; // true ==== $et_slide_header ?>
  297.  
  298.         <header id="main-header" data-height-onload="<?php echo esc_attr( et_get_option( 'menu_height', '66' ) ); ?>">
  299.             <div class="container clearfix et_menu_container">
  300.             <?php
  301.                 $logo = ( $user_logo = et_get_option( 'divi_logo' ) ) && '' != $user_logo
  302.                     ? $user_logo
  303.                     : $template_directory_uri . '/images/logo.png';
  304.             ?>
  305.                 <div class="logo_container">
  306.                     <span class="logo_helper"></span>
  307.                     <a href="<?php echo esc_url( home_url( '/' ) ); ?>">
  308.                         <img src="<?php echo esc_attr( $logo ); ?>" alt="<?php echo esc_attr( get_bloginfo( 'name' ) ); ?>" id="logo" data-height-percentage="<?php echo esc_attr( et_get_option( 'logo_height', '54' ) ); ?>" />
  309.                     </a>
  310.                     <h2 id="blog-description"><?php bloginfo('description'); ?></h2>
  311.                 </div>
  312.                 <div id="et-top-navigation" data-height="<?php echo esc_attr( et_get_option( 'menu_height', '66' ) ); ?>" data-fixed-height="<?php echo esc_attr( et_get_option( 'minimized_menu_height', '40' ) ); ?>">
  313.                     <?php if ( ! $et_slide_header || is_customize_preview() ) : ?>
  314.                         <nav id="top-menu-nav">
  315.                         <?php
  316.                             $menuClass = 'nav';
  317.                             if ( 'on' == et_get_option( 'divi_disable_toptier' ) ) $menuClass .= ' et_disable_top_tier';
  318.                             $primaryNav = '';
  319.  
  320.                             $primaryNav = wp_nav_menu( array( 'theme_location' => 'primary-menu', 'container' => '', 'fallback_cb' => '', 'menu_class' => $menuClass, 'menu_id' => 'top-menu', 'echo' => false ) );
  321.  
  322.                             if ( '' == $primaryNav ) :
  323.                         ?>
  324.                             <ul id="top-menu" class="<?php echo esc_attr( $menuClass ); ?>">
  325.                                 <?php if ( 'on' == et_get_option( 'divi_home_link' ) ) { ?>
  326.                                     <li <?php if ( is_home() ) echo( 'class="current_page_item"' ); ?>><a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php esc_html_e( 'Home', 'Divi' ); ?></a></li>
  327.                                 <?php }; ?>
  328.  
  329.                                 <?php show_page_menu( $menuClass, false, false ); ?>
  330.                                 <?php show_categories_menu( $menuClass, false ); ?>
  331.                             </ul>
  332.                         <?php
  333.                             else :
  334.                                 echo( $primaryNav );
  335.                             endif;
  336.                         ?>
  337.                         </nav>
  338.                     <?php endif; ?>
  339.  
  340.                     <?php
  341.                     if ( ! $et_top_info_defined && ( ! $et_slide_header || is_customize_preview() ) ) {
  342.                         et_show_cart_total( array(
  343.                             'no_text' => true,
  344.                         ) );
  345.                     }
  346.                     ?>
  347.  
  348.                     <?php if ( $et_slide_header || is_customize_preview() ) : ?>
  349.                         <span class="mobile_menu_bar et_pb_header_toggle et_toggle_<?php echo esc_attr( et_get_option( 'header_style', 'left' ) ); ?>_menu"></span>
  350.                     <?php endif; ?>
  351.  
  352.                     <?php if ( ( false !== et_get_option( 'show_search_icon', true ) && ! $et_slide_header ) || is_customize_preview() ) : ?>
  353.                     <div id="et_top_search">
  354.                         <span id="et_search_icon"></span>
  355.                     </div>
  356.                     <?php endif; // true === et_get_option( 'show_search_icon', false ) ?>
  357.  
  358.                     <?php do_action( 'et_header_top' ); ?>
  359.                 </div> <!-- #et-top-navigation -->
  360.             </div> <!-- .container -->
  361.             <div class="et_search_outer">
  362.                 <div class="container et_search_form_container">
  363.                     <form role="search" method="get" class="et-search-form" action="<?php echo esc_url( home_url( '/' ) ); ?>">
  364.                     <?php
  365.                         printf( '<input type="search" class="et-search-field" placeholder="%1$s" value="%2$s" name="s" title="%3$s" />',
  366.                             esc_attr__( 'Search &hellip;', 'Divi' ),
  367.                             get_search_query(),
  368.                             esc_attr__( 'Search for:', 'Divi' )
  369.                         );
  370.                     ?>
  371.                     </form>
  372.                     <span class="et_close_search_field"></span>
  373.                 </div>
  374.             </div>
  375.         </header> <!-- #main-header -->
  376.  
  377.         <div id="et-main-area">
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement