Advertisement
Guest User

header.php

a guest
Jun 12th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.96 KB | None | 0 0
  1. <?php
  2. /**
  3. * Theme Header Section for our theme.
  4. *
  5. * Displays all of the <head> section and everything up till <div id="main" class="clearfix"> <div class="inner-wrap">
  6. *
  7. * @package ThemeGrill
  8. * @subpackage Spacious
  9. * @since Spacious 1.0
  10. */
  11. ?><!DOCTYPE html>
  12. <!--[if IE 7]>
  13. <html class="ie ie7" <?php language_attributes(); ?>>
  14. <![endif]-->
  15. <!--[if IE 8]>
  16. <html class="ie ie8" <?php language_attributes(); ?>>
  17. <![endif]-->
  18. <!--[if !(IE 7) & !(IE 8)]><!-->
  19. <html <?php language_attributes(); ?>>
  20. <!--<![endif]-->
  21. <head>
  22. <meta charset="<?php bloginfo( 'charset' ); ?>"/>
  23. <meta name="viewport" content="width=device-width, initial-scale=1">
  24. <link rel="profile" href="http://gmpg.org/xfn/11"/>
  25. <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>"/>
  26. <?php
  27. /**
  28. * This hook is important for wordpress plugins and other many things
  29. */
  30. wp_head();
  31. ?>
  32. </head>
  33.  
  34. <body <?php body_class(); ?>>
  35. <?php do_action( 'before' ); ?>
  36. <div id="page" class="hfeed site">
  37. <?php do_action( 'spacious_before_header' ); ?>
  38.  
  39. <?php
  40. $spacious_header_design = spacious_options( 'spacious_header_design', 'style_one' );
  41. $header_class = '';
  42. if ( $spacious_header_design === 'style_two' ) {
  43. $header_class = 'spacious-header-style-two';
  44. }
  45. ?>
  46.  
  47. <header id="masthead" class="site-header clearfix <?php echo esc_attr( $header_class ); ?>">
  48.  
  49. <?php if ( spacious_options( 'spacious_header_image_position', 'above' ) == 'above' ) {
  50. spacious_render_header_image();
  51. } ?>
  52.  
  53. <div id="header-text-nav-container">
  54. <?php if ( $spacious_header_design !== 'style_two' ): ?>
  55. <div class="inner-wrap">
  56. <?php endif; ?>
  57.  
  58. <div id="header-text-nav-wrap" class="clearfix">
  59. <div id="header-left-section">
  60. <?php if ( $spacious_header_design === 'style_two' ): ?>
  61. <div class="inner-wrap clearfix">
  62. <?php endif;
  63.  
  64. if ( ( spacious_options( 'spacious_show_header_logo_text', 'text_only' ) == 'both' || spacious_options( 'spacious_show_header_logo_text', 'text_only' ) == 'logo_only' ) ) { ?>
  65. <div id="header-logo-image">
  66. <?php if ( spacious_options( 'spacious_header_logo_image', '' ) != '' ) { ?>
  67. <a href="<?php echo esc_url( home_url( '/' ) ); ?>"
  68. title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>"
  69. rel="home"><img
  70. src="<?php echo spacious_options( 'spacious_header_logo_image', '' ); ?>"
  71. alt="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>"></a>
  72. <?php } ?>
  73.  
  74. <?php if ( function_exists( 'the_custom_logo' ) && has_custom_logo( $blog_id = 0 ) ) {
  75. spacious_the_custom_logo();
  76. } ?>
  77. </div><!-- #header-logo-image -->
  78.  
  79. <?php
  80. }
  81.  
  82. $screen_reader = '';
  83. if ( ( spacious_options( 'spacious_show_header_logo_text', 'text_only' ) == 'logo_only' || spacious_options( 'spacious_show_header_logo_text', 'text_only' ) == 'none' ) ) {
  84. $screen_reader = 'screen-reader-text';
  85. }?>
  86.  
  87. <div id="header-text" class="<?php echo $screen_reader; ?>">
  88. <?php if ( is_front_page() || is_home() ) : ?>
  89. <h1 id="site-title">
  90. <a href="<?php echo esc_url( home_url( '/' ) ); ?>"
  91. title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>"
  92. rel="home"><?php bloginfo( 'name' ); ?></a>
  93. </h1>
  94. <?php else : ?>
  95. <h3 id="site-title">
  96. <a href="<?php echo esc_url( home_url( '/' ) ); ?>"
  97. title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>"
  98. rel="home"><?php bloginfo( 'name' ); ?></a>
  99. </h3>
  100. <?php endif;
  101.  
  102. $description = get_bloginfo( 'description', 'display' );
  103. if ( $description || is_customize_preview() ) : ?>
  104. <p id="site-description"><?php echo $description; ?></p>
  105. <?php endif; ?><!-- #site-description -->
  106. </div><!-- #header-text -->
  107.  
  108. <?php if ( $spacious_header_design === 'style_two' ): ?>
  109. </div><!-- .inner-wrap -->
  110. <?php endif; ?>
  111. </div><!-- #header-left-section -->
  112. <div id="header-right-section">
  113. <?php if ( $spacious_header_design === 'style_two' ): ?>
  114. <div class="inner-wrap clearfix">
  115. <?php endif;
  116.  
  117. if ( is_active_sidebar( 'spacious_header_sidebar' ) ) {
  118. ?>
  119. <div id="header-right-sidebar" class="clearfix">
  120. <?php
  121. // Calling the header sidebar if it exists.
  122. if ( ! dynamic_sidebar( 'spacious_header_sidebar' ) ):
  123. endif;
  124. ?>
  125. </div>
  126. <?php
  127. } ?>
  128.  
  129. <nav id="site-navigation" class="main-navigation" role="navigation">
  130. <p class="menu-toggle"><?php _e( 'Menu', 'spacious' ); ?></p>
  131. <?php
  132. if ( has_nav_menu( 'primary' ) ) {
  133. wp_nav_menu( array(
  134. 'theme_location' => 'primary',
  135. 'container_class' => 'menu-primary-container'
  136. ) );
  137. } else {
  138. wp_page_menu();
  139. }
  140. ?>
  141. </nav>
  142.  
  143. <?php if ( $spacious_header_design === 'style_two' ): ?>
  144. </div><!-- .inner-wrap -->
  145. <?php endif; ?>
  146. </div><!-- #header-right-section -->
  147.  
  148. </div><!-- #header-text-nav-wrap -->
  149. <?php if ( $spacious_header_design !== 'style_two' ): ?>
  150. </div><!-- .inner-wrap -->
  151. <?php endif; ?>
  152. </div><!-- #header-text-nav-container -->
  153.  
  154. <?php if ( spacious_options( 'spacious_header_image_position', 'above' ) == 'below' ) {
  155. spacious_render_header_image();
  156. } ?>
  157.  
  158. <?php
  159. if ( spacious_options( 'spacious_activate_slider', '0' ) == '1' ) {
  160. if ( spacious_options( 'spacious_blog_slider', '0' ) != '1' ) {
  161. if ( is_home() || is_front_page() ) {
  162. spacious_featured_image_slider();
  163. }
  164. } else {
  165. if ( is_front_page() ) {
  166. spacious_featured_image_slider();
  167. }
  168. }
  169. }
  170.  
  171. if ( ( '' != spacious_header_title() ) && ! ( is_front_page() ) ) {
  172. if ( ! ( spacious_options( 'spacious_blog_slider', '0' ) != '1' && is_home() ) ) { ?>
  173. <div class="header-post-title-container clearfix">
  174. <div class="inner-wrap">
  175. <div class="post-title-wrapper">
  176. <?php
  177. if ( '' != spacious_header_title() ) {
  178. ?>
  179. <?php if ( is_home() ) : ?>
  180. <h2 class="header-post-title-class"><?php echo spacious_header_title(); ?></h2>
  181. <?php else : ?>
  182. <h1 class="header-post-title-class"><?php echo spacious_header_title(); ?></h1>
  183. <?php if ( function_exists( 'the_subtitle' ) ) {
  184. the_subtitle( '<p class="entry-subtitle">', '</p>' );
  185. } ?>
  186. <?php endif; ?>
  187. <?php
  188. }
  189. ?>
  190. </div>
  191. <?php if ( function_exists( 'spacious_breadcrumb' ) ) {
  192. spacious_breadcrumb();
  193. } ?>
  194. </div>
  195. </div>
  196. <?php
  197. }
  198. }
  199. ?>
  200. </header>
  201. <?php do_action( 'spacious_after_header' ); ?>
  202. <?php do_action( 'spacious_before_main' ); ?>
  203. <div id="main" class="clearfix">
  204. <div class="inner-wrap">
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement