header.php 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <?php
  2. /**
  3. * The template for displaying the header
  4. *
  5. * Displays all of the head element and everything up until the "site-content" div.
  6. *
  7. * @package WordPress
  8. * @subpackage Twenty_Sixteen
  9. * @since Twenty Sixteen 1.0
  10. */
  11. ?><!DOCTYPE html>
  12. <html <?php language_attributes(); ?> class="no-js">
  13. <head>
  14. <meta charset="<?php bloginfo( 'charset' ); ?>">
  15. <meta name="viewport" content="width=device-width, initial-scale=1">
  16. <link rel="profile" href="http://gmpg.org/xfn/11">
  17. <?php if ( is_singular() && pings_open( get_queried_object() ) ) : ?>
  18. <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
  19. <?php endif; ?>
  20. <?php wp_head(); ?>
  21. </head>
  22. <body <?php body_class(); ?>>
  23. <div id="page" class="hfeed site">
  24. <div class="site-inner">
  25. <a class="skip-link screen-reader-text" href="#content"><?php _e( 'Skip to content', 'twentysixteen' ); ?></a>
  26. <header id="masthead" class="site-header" role="banner">
  27. <div class="site-header-main">
  28. <div class="site-branding">
  29. <?php if ( is_front_page() && is_home() ) : ?>
  30. <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
  31. <?php else : ?>
  32. <p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
  33. <?php endif;
  34. $description = get_bloginfo( 'description', 'display' );
  35. if ( $description || is_customize_preview() ) : ?>
  36. <p class="site-description"><?php echo $description; ?></p>
  37. <?php endif; ?>
  38. </div><!-- .site-branding -->
  39. <?php if ( has_nav_menu( 'primary' ) || has_nav_menu( 'social' ) ) : ?>
  40. <button id="menu-toggle" class="menu-toggle"><?php _e( 'Menu', 'twentysixteen' ); ?></button>
  41. <div id="site-header-menu" class="site-header-menu">
  42. <?php if ( has_nav_menu( 'primary' ) ) : ?>
  43. <nav id="site-navigation" class="main-navigation" role="navigation" aria-label="<?php _e( 'Primary Menu', 'twentysixteen' ); ?>">
  44. <?php
  45. wp_nav_menu( array(
  46. 'theme_location' => 'primary',
  47. 'menu_class' => 'primary-menu',
  48. ) );
  49. ?>
  50. </nav><!-- .main-navigation -->
  51. <?php endif; ?>
  52. <?php if ( has_nav_menu( 'social' ) ) : ?>
  53. <nav id="social-navigation" class="social-navigation" role="navigation" aria-label="<?php _e( 'Social Links Menu', 'twentysixteen' ); ?>">
  54. <?php
  55. wp_nav_menu( array(
  56. 'theme_location' => 'social',
  57. 'menu_class' => 'social-links-menu',
  58. 'depth' => 1,
  59. 'link_before' => '<span class="screen-reader-text">',
  60. 'link_after' => '</span>',
  61. ) );
  62. ?>
  63. </nav><!-- .social-navigation -->
  64. <?php endif; ?>
  65. </div><!-- .site-header-menu -->
  66. <?php endif; ?>
  67. </div><!-- .site-header-main -->
  68. <?php if ( get_header_image() ) : ?>
  69. <div class="header-image">
  70. <a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home">
  71. <img src="<?php header_image(); ?>" width="<?php echo esc_attr( get_custom_header()->width ); ?>" height="<?php echo esc_attr( get_custom_header()->height ); ?>" alt="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>">
  72. </a>
  73. </div>
  74. <?php endif; // End header image check. ?>
  75. </header><!-- .site-header -->
  76. <div id="content" class="site-content">