EduardET

custom header

Nov 14th, 2017
741
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 11.59 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.     <?php wp_head(); ?>
  34. </head>
  35. <body <?php body_class(); ?>>
  36. <?php
  37.     $product_tour_enabled = et_builder_is_product_tour_enabled();
  38.     $page_container_style = $product_tour_enabled ? ' style="padding-top: 0px;"' : ''; ?>
  39.     <div id="page-container"<?php echo $page_container_style; ?>>
  40. <?php
  41.     if ( $product_tour_enabled || is_page_template( 'page-template-blank.php' ) ) {
  42.         return;
  43.     }
  44.  
  45.     $et_secondary_nav_items = et_divi_get_top_nav_items();
  46.  
  47.     $et_phone_number = $et_secondary_nav_items->phone_number;
  48.  
  49.     $et_email = $et_secondary_nav_items->email;
  50.  
  51.     $et_contact_info_defined = $et_secondary_nav_items->contact_info_defined;
  52.  
  53.     $show_header_social_icons = $et_secondary_nav_items->show_header_social_icons;
  54.  
  55.     $et_secondary_nav = $et_secondary_nav_items->secondary_nav;
  56.  
  57.     $et_top_info_defined = $et_secondary_nav_items->top_info_defined;
  58.  
  59.     $et_slide_header = 'slide' === et_get_option( 'header_style', 'left' ) || 'fullscreen' === et_get_option( 'header_style', 'left' ) ? true : false;
  60. ?>
  61.  
  62.     <?php if ( $et_top_info_defined && ! $et_slide_header || is_customize_preview() ) : ?>
  63.         <div id="top-header"<?php echo $et_top_info_defined ? '' : 'style="display: none;"'; ?>>
  64.             <div class="container clearfix">
  65.  
  66.             <?php if ( $et_contact_info_defined ) : ?>
  67.  
  68.                 <div id="et-info">
  69.                 <?php if ( '' !== ( $et_phone_number = et_get_option( 'phone_number' ) ) ) : ?>
  70.                     <span id="et-info-phone"><?php echo et_sanitize_html_input_text( $et_phone_number ); ?></span>
  71.                 <?php endif; ?>
  72.  
  73.                 <?php if ( '' !== ( $et_email = et_get_option( 'header_email' ) ) ) : ?>
  74.                     <a href="<?php echo esc_attr( 'mailto:' . $et_email ); ?>"><span id="et-info-email"><?php echo esc_html( $et_email ); ?></span></a>
  75.                 <?php endif; ?>
  76.  
  77.                 <?php
  78.                 if ( true === $show_header_social_icons ) {
  79.                     get_template_part( 'includes/social_icons', 'header' );
  80.                 } ?>
  81.                 </div> <!-- #et-info -->
  82.  
  83.             <?php endif; // true === $et_contact_info_defined ?>
  84.  
  85.                 <div id="et-secondary-menu">
  86.                 <?php
  87.                     if ( ! $et_contact_info_defined && true === $show_header_social_icons ) {
  88.                         get_template_part( 'includes/social_icons', 'header' );
  89.                     } else if ( $et_contact_info_defined && true === $show_header_social_icons ) {
  90.                         ob_start();
  91.  
  92.                         get_template_part( 'includes/social_icons', 'header' );
  93.  
  94.                         $duplicate_social_icons = ob_get_contents();
  95.  
  96.                         ob_end_clean();
  97.  
  98.                         printf(
  99.                             '<div class="et_duplicate_social_icons">
  100.                                 %1$s
  101.                             </div>',
  102.                             $duplicate_social_icons
  103.                         );
  104.                     }
  105.  
  106.                     if ( '' !== $et_secondary_nav ) {
  107.                         echo $et_secondary_nav;
  108.                     }
  109.  
  110.                     et_show_cart_total();
  111.                 ?>
  112.                 </div> <!-- #et-secondary-menu -->
  113.  
  114.             </div> <!-- .container -->
  115.         </div> <!-- #top-header -->
  116.     <?php else: ?>
  117.         <div id="top-header"<?php echo !$et_top_info_defined ? '' : 'style="display: none;"'; ?>>
  118.             <div class="container clearfix">
  119.                 <?php $lang = get_bloginfo("language"); ?>
  120.                 <?php if ($lang == "nl-NL") : ?>
  121.                     <div id="et-info">         
  122.                         <a href="tel:0031628871470">
  123.                             <span id="et-info-phone">00316 288 714 70</span>
  124.                         </a>
  125.                         <a href="mailto:[email protected]">
  126.                             <span id="et-info-email">[email protected]</span>
  127.                         </a>
  128.                         |
  129.                         <a id="overlay_unique_id_1555" href="#open">Aanvraagformulier</a>
  130.                         |
  131.                         <a id="overlay_unique_id_1843" href="#open">Klanten</a>
  132.                     </div>
  133.                 <?php else : ?>
  134.                     <div id="et-info">         
  135.                         <a href="tel:0031628871470">
  136.                             <span id="et-info-phone">00316 288 714 70</span>
  137.                         </a>
  138.                         <a href="mailto:[email protected]">
  139.                             <span id="et-info-email">[email protected]</span>
  140.                         </a>
  141.                         |
  142.                         <a id="overlay_unique_id_1555" href="#open">Aanvraagformulier</a>
  143.                         |
  144.                         <a id="overlay_unique_id_1843" href="#open">Klanten</a>
  145.                     </div>
  146.                 <?php endif; ?>
  147.             </div>
  148.         </div>
  149.     <?php endif; // true ==== $et_top_info_defined ?>
  150.  
  151.     <?php if ( $et_slide_header || is_customize_preview() ) : ?>
  152.         <div class="et_slide_in_menu_container">
  153.             <?php if ( 'fullscreen' === et_get_option( 'header_style', 'left' ) || is_customize_preview() ) { ?>
  154.                 <span class="mobile_menu_bar et_toggle_fullscreen_menu"></span>
  155.             <?php } ?>
  156.  
  157.             <?php
  158.                 if ( $et_contact_info_defined || true === $show_header_social_icons || false !== et_get_option( 'show_search_icon', true ) || class_exists( 'woocommerce' ) || is_customize_preview() ) { ?>
  159.                     <div class="et_slide_menu_top">
  160.  
  161.                     <?php if ( 'fullscreen' === et_get_option( 'header_style', 'left' ) ) { ?>
  162.                         <div class="et_pb_top_menu_inner">
  163.                     <?php } ?>
  164.             <?php }
  165.  
  166.                 if ( true === $show_header_social_icons ) {
  167.                     get_template_part( 'includes/social_icons', 'header' );
  168.                 }
  169.  
  170.                 et_show_cart_total();
  171.             ?>
  172.             <?php if ( false !== et_get_option( 'show_search_icon', true ) || is_customize_preview() ) : ?>
  173.                 <?php if ( 'fullscreen' !== et_get_option( 'header_style', 'left' ) ) { ?>
  174.                     <div class="clear"></div>
  175.                 <?php } ?>
  176.                 <form role="search" method="get" class="et-search-form" action="<?php echo esc_url( home_url( '/' ) ); ?>">
  177.                     <?php
  178.                         printf( '<input type="search" class="et-search-field" placeholder="%1$s" value="%2$s" name="s" title="%3$s" />',
  179.                             esc_attr__( 'Search &hellip;', 'Divi' ),
  180.                             get_search_query(),
  181.                             esc_attr__( 'Search for:', 'Divi' )
  182.                         );
  183.                     ?>
  184.                     <button type="submit" id="searchsubmit_header"></button>
  185.                 </form>
  186.             <?php endif; // true === et_get_option( 'show_search_icon', false ) ?>
  187.  
  188.             <?php if ( $et_contact_info_defined ) : ?>
  189.  
  190.                 <div id="et-info">
  191.                 <?php if ( '' !== ( $et_phone_number = et_get_option( 'phone_number' ) ) ) : ?>
  192.                     <span id="et-info-phone"><?php echo et_sanitize_html_input_text( $et_phone_number ); ?></span>
  193.                 <?php endif; ?>
  194.  
  195.                 <?php if ( '' !== ( $et_email = et_get_option( 'header_email' ) ) ) : ?>
  196.                     <a href="<?php echo esc_attr( 'mailto:' . $et_email ); ?>"><span id="et-info-email"><?php echo esc_html( $et_email ); ?></span></a>
  197.                 <?php endif; ?>
  198.                 </div> <!-- #et-info -->
  199.  
  200.             <?php endif; // true === $et_contact_info_defined ?>
  201.             <?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() ) { ?>
  202.                 <?php if ( 'fullscreen' === et_get_option( 'header_style', 'left' ) ) { ?>
  203.                     </div> <!-- .et_pb_top_menu_inner -->
  204.                 <?php } ?>
  205.  
  206.                 </div> <!-- .et_slide_menu_top -->
  207.             <?php } ?>
  208.  
  209.             <div class="et_pb_fullscreen_nav_container">
  210.                 <?php
  211.                     $slide_nav = '';
  212.                     $slide_menu_class = 'et_mobile_menu';
  213.  
  214.                     $slide_nav = wp_nav_menu( array( 'theme_location' => 'primary-menu', 'container' => '', 'fallback_cb' => '', 'echo' => false, 'items_wrap' => '%3$s' ) );
  215.                     $slide_nav .= wp_nav_menu( array( 'theme_location' => 'secondary-menu', 'container' => '', 'fallback_cb' => '', 'echo' => false, 'items_wrap' => '%3$s' ) );
  216.                 ?>
  217.  
  218.                 <ul id="mobile_menu_slide" class="<?php echo esc_attr( $slide_menu_class ); ?>">
  219.  
  220.                 <?php
  221.                     if ( '' == $slide_nav ) :
  222.                 ?>
  223.                         <?php if ( 'on' == et_get_option( 'divi_home_link' ) ) { ?>
  224.                             <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>
  225.                         <?php }; ?>
  226.  
  227.                         <?php show_page_menu( $slide_menu_class, false, false ); ?>
  228.                         <?php show_categories_menu( $slide_menu_class, false ); ?>
  229.                 <?php
  230.                     else :
  231.                         echo( $slide_nav );
  232.                     endif;
  233.                 ?>
  234.  
  235.                 </ul>
  236.             </div>
  237.         </div>
  238.     <?php endif; // true ==== $et_slide_header ?>
  239.  
  240.         <header id="main-header" data-height-onload="<?php echo esc_attr( et_get_option( 'menu_height', '66' ) ); ?>">
  241.             <div class="container clearfix et_menu_container">
  242.             <?php
  243.                 $logo = ( $user_logo = et_get_option( 'divi_logo' ) ) && '' != $user_logo
  244.                     ? $user_logo
  245.                     : $template_directory_uri . '/images/logo.png';
  246.             ?>
  247.                 <div class="logo_container">
  248.                     <span class="logo_helper"></span>
  249.                     <a href="<?php echo esc_url( home_url( '/' ) ); ?>">
  250.                         <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' ) ); ?>" />
  251.                     </a>
  252.                 </div>
  253.                 <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' ) ); ?>">
  254.                     <?php if ( ! $et_slide_header || is_customize_preview() ) : ?>
  255.                         <nav id="top-menu-nav">
  256.                         <?php
  257.                             $menuClass = 'nav';
  258.                             if ( 'on' == et_get_option( 'divi_disable_toptier' ) ) $menuClass .= ' et_disable_top_tier';
  259.                             $primaryNav = '';
  260.  
  261.                             $primaryNav = wp_nav_menu( array( 'theme_location' => 'primary-menu', 'container' => '', 'fallback_cb' => '', 'menu_class' => $menuClass, 'menu_id' => 'top-menu', 'echo' => false ) );
  262.  
  263.                             if ( '' == $primaryNav ) :
  264.                         ?>
  265.                             <ul id="top-menu" class="<?php echo esc_attr( $menuClass ); ?>">
  266.                                 <?php if ( 'on' == et_get_option( 'divi_home_link' ) ) { ?>
  267.                                     <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>
  268.                                 <?php }; ?>
  269.  
  270.                                 <?php show_page_menu( $menuClass, false, false ); ?>
  271.                                 <?php show_categories_menu( $menuClass, false ); ?>
  272.                             </ul>
  273.                         <?php
  274.                             else :
  275.                                 echo( $primaryNav );
  276.                             endif;
  277.                         ?>
  278.                         </nav>
  279.                     <?php endif; ?>
  280.  
  281.                     <?php
  282.                     if ( ! $et_top_info_defined && ( ! $et_slide_header || is_customize_preview() ) ) {
  283.                         et_show_cart_total( array(
  284.                             'no_text' => true,
  285.                         ) );
  286.                     }
  287.                     ?>
  288.  
  289.                     <?php if ( $et_slide_header || is_customize_preview() ) : ?>
  290.                         <span class="mobile_menu_bar et_pb_header_toggle et_toggle_<?php echo esc_attr( et_get_option( 'header_style', 'left' ) ); ?>_menu"></span>
  291.                     <?php endif; ?>
  292.  
  293.                     <?php if ( ( false !== et_get_option( 'show_search_icon', true ) && ! $et_slide_header ) || is_customize_preview() ) : ?>
  294.                     <div id="et_top_search">
  295.                         <span id="et_search_icon"></span>
  296.                     </div>
  297.                     <?php endif; // true === et_get_option( 'show_search_icon', false ) ?>
  298.  
  299.                     <?php do_action( 'et_header_top' ); ?>
  300.                 </div> <!-- #et-top-navigation -->
  301.             </div> <!-- .container -->
  302.             <div class="et_search_outer">
  303.                 <div class="container et_search_form_container">
  304.                     <form role="search" method="get" class="et-search-form" action="<?php echo esc_url( home_url( '/' ) ); ?>">
  305.                     <?php
  306.                         printf( '<input type="search" class="et-search-field" placeholder="%1$s" value="%2$s" name="s" title="%3$s" />',
  307.                             esc_attr__( 'Search &hellip;', 'Divi' ),
  308.                             get_search_query(),
  309.                             esc_attr__( 'Search for:', 'Divi' )
  310.                         );
  311.                     ?>
  312.                     </form>
  313.                     <span class="et_close_search_field"></span>
  314.                 </div>
  315.             </div>
  316.         </header> <!-- #main-header -->
  317.  
  318.         <div id="et-main-area">
Advertisement
Add Comment
Please, Sign In to add comment