Advertisement
Jawn78

Untitled

Aug 30th, 2016
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.96 KB | None | 0 0
  1. <?php
  2. /**
  3. * The template part for displaying header.
  4. * @package TheFour
  5. */
  6. ?>
  7. <!DOCTYPE html>
  8. <html <?php language_attributes(); ?>>
  9. <head>
  10. <meta charset="<?php bloginfo( 'charset' ); ?>">
  11. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
  12. <?php wp_head(); ?>
  13. </head>
  14.  
  15. <body <?php body_class(); ?>>
  16.  
  17. <div class="wrapper">
  18. <div class="header-wrapper">
  19. }
  20. <?php get_template_part( 'template-parts/topbar' ); ?>
  21. <header class="header" style="background-image: url(<?php header_image(); ?>)" role="banner">
  22. <div class="navbar">
  23. <div class="container clearfix">
  24. <?php
  25. $brand = esc_html( get_bloginfo() );
  26. if ( $logo = thefour_setting( 'logo' ) )
  27. {
  28. $brand = sprintf( '<img src="%s" alt="%s">', esc_url( $logo ), esc_attr( get_bloginfo() ) );
  29. }
  30. /**
  31. * Allow developers to change the output of the brand
  32. * @param string $brand HTML output of the brand
  33. */
  34. $brand = apply_filters( 'thefour_brand', $brand );
  35. ?>
  36. <a class="brand" href="<?php echo esc_url( home_url() ); ?>"><?php echo $brand; ?></a>
  37. <nav class="site-navigation right" role="navigation" aria-label="<?php esc_html_e( 'Primary Navigation', 'thefour' ); ?>">
  38. <button class="menu-toggle"><?php _e( 'Menu', 'thefour' ); ?></button>
  39. <?php
  40. wp_nav_menu( array(
  41. 'container_class' => 'main-menu',
  42. 'menu_class' => 'main-menu clearfix',
  43. 'theme_location' => 'primary',
  44. 'items_wrap' => '<ul>%3$s</ul>',
  45. ) );
  46. ?>
  47. </nav>
  48. <a class="screen-reader-text skip-link" href="#content"><?php _e( 'Skip to content', 'thefour' ); ?></a>
  49. </div>
  50. </div>
  51. <?php
  52. $class = 'title-center';
  53. if ( is_single() )
  54. {
  55. $class = thefour_setting( 'single_title_position' );
  56. $class = $class ? $class : 'title-center';
  57.  
  58. // Center the post title if layout is no sidebar
  59. $layout = thefour_setting( 'single_sidebar_layout' );
  60. $class = ! $layout || 'no-sidebar' == $layout ? 'title-center' : $class;
  61. }
  62.  
  63. $class = trim( $class );
  64. $class = $class ? ' ' . $class : '';
  65. ?>
  66. <div class="header-inner container<?php echo esc_attr( $class ); ?>">
  67. <?php
  68. if ( $hero_content = thefour_setting( 'hero_content' ) )
  69. {
  70. echo do_shortcode( $hero_content );
  71. }
  72. else
  73. {
  74. $site_title = get_bloginfo();
  75. $site_description = get_bloginfo( 'description' );
  76. if ( $site_title )
  77. {
  78. printf(
  79. '<h1 class="site-title"><a href="%s" title="%s" rel="home">%s</a></h1>',
  80. esc_url( home_url() ),
  81. esc_attr( $site_title ),
  82. esc_html( $site_title )
  83. );
  84. }
  85. if ( $site_description )
  86. {
  87. printf(
  88. '<h3 class="site-description">%s</h3>',
  89. esc_html( $site_description )
  90. );
  91. }
  92. }
  93. ?>
  94. </div>
  95. </header>
  96. </div>
  97. <main class="main container clearfix" role="main">
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement