Guest User

header.php

a guest
Apr 2nd, 2020
384
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.33 KB | None | 0 0
  1. <?php
  2. /**
  3. * The header for our theme
  4. *
  5. * This is the template that displays all of the <head> section and everything up until <div id="content">
  6. *
  7. * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
  8. *
  9. * @package HitMag
  10. */
  11.  
  12. ?><!DOCTYPE html>
  13. <html <?php language_attributes(); ?>>
  14. <head>
  15. <meta charset="<?php bloginfo( 'charset' ); ?>">
  16. <meta name="viewport" content="width=device-width, initial-scale=1">
  17. <link rel="profile" href="http://gmpg.org/xfn/11">
  18. <meta name="google-site-verification" content="2g-EfOr_gnVf_j6iORH6GuQaNHapPGCX6QhE_6t_RbA" />
  19. <!-- Global site tag (gtag.js) - Google Analytics -->
  20. <script async src="https://www.googletagmanager.com/gtag/js?id=UA-154685450-1"></script>
  21. <script>
  22. window.dataLayer = window.dataLayer || [];
  23. function gtag(){dataLayer.push(arguments);}
  24. gtag('js', new Date());
  25.  
  26. gtag('config', 'UA-154685450-1');
  27. </script>
  28. <!-- Global site tag (gtag.js) - Google Analytics -->
  29. <?php wp_head(); ?>
  30. </head>
  31.  
  32. <body <?php body_class(); ?>>
  33.  
  34. <?php
  35. /**
  36. * WordPress function to load custom scripts after body.
  37. *
  38. * Introduced in WordPress 5.2.0
  39. *
  40. * @since HitMag 1.2.6
  41. */
  42. if ( function_exists( 'wp_body_open' ) ) {
  43. wp_body_open();
  44. }
  45. ?>
  46.  
  47. <?php do_action( 'hitmag_before_site' ); ?>
  48.  
  49. <div id="page" class="site hitmag-wrapper">
  50. <a class="skip-link screen-reader-text" href="#content"><?php esc_html_e( 'Skip to content', 'hitmag' ); ?></a>
  51.  
  52. <?php do_action( 'hitmag_before_header' ); ?>
  53.  
  54. <header id="masthead" class="site-header" role="banner">
  55.  
  56. <?php if ( true == get_theme_mod( 'display_topbar', 'true' ) ) : ?>
  57.  
  58. <?php if ( has_nav_menu( 'menu-2' ) ) : ?>
  59.  
  60. <div class="hm-topnavbutton">
  61. <div class="hm-nwrap">
  62. <a href="#" class="navbutton" id="top-nav-button"><?php esc_html_e( 'Top Menu', 'hitmag' ); ?></a>
  63.  
  64. </div>
  65. </div>
  66. <div class="responsive-topnav"></div>
  67. <?php endif; ?>
  68.  
  69. <div class="hm-top-bar">
  70. <div class="hm-container">
  71.  
  72. <?php if ( true == get_theme_mod( 'show_topbar_date', 'true' ) ) : ?>
  73. <div class="hm-date"><?php echo date_i18n( get_option( 'date_format' ) ); ?></div>
  74.  
  75. <?php endif; ?>
  76.  
  77. <?php if ( has_nav_menu( 'menu-2' ) ) : ?>
  78. <div id="top-navigation" class="top-navigation">
  79. <?php wp_nav_menu( array( 'theme_location' => 'menu-2', 'menu_id' => 'top-menu' ) ); ?>
  80. </div>
  81.  
  82. <?php endif; ?>
  83.  
  84. <?php get_template_part( 'template-parts/menu', 'social' ); ?>
  85.  
  86. </div><!-- .hm-container -->
  87. </div><!-- .hm-top-bar -->
  88.  
  89. <?php endif; ?>
  90.  
  91. <?php if ( get_theme_mod( 'header_image_position', 'after-site-title' ) == 'before-site-title' ) { hitmag_header_image(); } ?>
  92.  
  93. <div class="header-main-area <?php hitmag_header_bg_image_class(); ?>">
  94. <div class="hm-container">
  95. <div class="site-branding">
  96. <div class="site-branding-content">
  97. <div class="hm-logo">
  98. <?php hitmag_the_custom_logo(); ?>
  99. </div><!-- .hm-logo -->
  100.  
  101. <div class="hm-site-title">
  102. <?php
  103. if ( is_front_page() || is_home() ) : ?>
  104. <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
  105. <?php else : ?>
  106. <p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
  107. <?php
  108. endif;
  109.  
  110. $description = get_bloginfo( 'description', 'display' );
  111. if ( $description || is_customize_preview() ) : ?>
  112. <p class="site-description"><?php echo $description; /* WPCS: xss ok. */ ?></p>
  113. <?php
  114. endif; ?>
  115. </div><!-- .hm-site-title -->
  116. </div><!-- .site-branding-content -->
  117. </div><!-- .site-branding -->
  118.  
  119. <?php do_action( 'hitmag_after_site_logo' ); ?>
  120.  
  121. <?php
  122. if ( is_active_sidebar( 'sidebar-header' ) ) {
  123. echo '<div class="hm-header-sidebar">';
  124. dynamic_sidebar( 'sidebar-header' );
  125. echo '</div>';
  126. }
  127. ?>
  128. </div><!-- .hm-container -->
  129. </div><!-- .header-main-area -->
  130.  
  131. <?php if ( get_theme_mod( 'header_image_position', 'after-site-title' ) == 'after-site-title' ) { hitmag_header_image(); } ?>
  132.  
  133. <div class="hm-nav-container">
  134. <nav id="site-navigation" class="main-navigation" role="navigation">
  135. <div class="hm-container">
  136. <?php wp_nav_menu( array( 'theme_location' => 'menu-1', 'menu_id' => 'primary-menu' ) ); ?>
  137.  
  138. <?php if ( true == get_theme_mod( 'show_nav_search', true ) ) : ?>
  139. <div class="hm-search-button-icon"></div>
  140. <div class="hm-search-box-container">
  141. <div class="hm-search-box">
  142. <?php get_search_form(); ?>
  143. </div><!-- th-search-box -->
  144. </div><!-- .th-search-box-container -->
  145. <?php endif; ?>
  146. </div><!-- .hm-container -->
  147. </nav><!-- #site-navigation -->
  148. <div class="hm-nwrap">
  149. <a href="#" class="navbutton" id="main-nav-button"><?php esc_html_e( 'Main Menu', 'hitmag' ); ?></a>
  150. </div>
  151. <div class="responsive-mainnav"></div>
  152. </div><!-- .hm-nav-container -->
  153.  
  154. <?php if ( get_theme_mod( 'header_image_position', 'after-site-title' ) == 'after-main-nav' ) { hitmag_header_image(); } ?>
  155.  
  156. </header><!-- #masthead -->
  157.  
  158. <?php do_action( 'hitmag_after_header' ); ?>
  159.  
  160. <div id="content" class="site-content">
  161. <div class="hm-container">
Add Comment
Please, Sign In to add comment