[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-content/themes/twentysixteen/ -> header.php (source)

   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  
  12  ?><!DOCTYPE html>
  13  <html <?php language_attributes(); ?> class="no-js">
  14  <head>
  15      <meta charset="<?php bloginfo( 'charset' ); ?>">
  16      <meta name="viewport" content="width=device-width, initial-scale=1.0">
  17      <link rel="profile" href="https://gmpg.org/xfn/11">
  18      <?php if ( is_singular() && pings_open( get_queried_object() ) ) : ?>
  19      <link rel="pingback" href="<?php echo esc_url( get_bloginfo( 'pingback_url' ) ); ?>">
  20      <?php endif; ?>
  21      <?php wp_head(); ?>
  22  </head>
  23  
  24  <body <?php body_class(); ?>>
  25  <?php wp_body_open(); ?>
  26  <div id="page" class="site">
  27      <div class="site-inner">
  28          <a class="skip-link screen-reader-text" href="#content">
  29              <?php
  30              /* translators: Hidden accessibility text. */
  31              _e( 'Skip to content', 'twentysixteen' );
  32              ?>
  33          </a>
  34  
  35          <header id="masthead" class="site-header">
  36              <div class="site-header-main">
  37                  <div class="site-branding">
  38                      <?php twentysixteen_the_custom_logo(); ?>
  39  
  40                      <?php if ( is_front_page() && is_home() ) : ?>
  41                          <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
  42                      <?php else : ?>
  43                          <p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
  44                          <?php
  45                      endif;
  46  
  47                      $description = get_bloginfo( 'description', 'display' );
  48                      if ( $description || is_customize_preview() ) :
  49                          ?>
  50                          <p class="site-description"><?php echo $description; ?></p>
  51                      <?php endif; ?>
  52                  </div><!-- .site-branding -->
  53  
  54                  <?php if ( has_nav_menu( 'primary' ) || has_nav_menu( 'social' ) ) : ?>
  55                      <button id="menu-toggle" class="menu-toggle"><?php _e( 'Menu', 'twentysixteen' ); ?></button>
  56  
  57                      <div id="site-header-menu" class="site-header-menu">
  58                          <?php if ( has_nav_menu( 'primary' ) ) : ?>
  59                              <nav id="site-navigation" class="main-navigation" aria-label="<?php esc_attr_e( 'Primary Menu', 'twentysixteen' ); ?>">
  60                                  <?php
  61                                      wp_nav_menu(
  62                                          array(
  63                                              'theme_location' => 'primary',
  64                                              'menu_class' => 'primary-menu',
  65                                          )
  66                                      );
  67                                  ?>
  68                              </nav><!-- .main-navigation -->
  69                          <?php endif; ?>
  70  
  71                          <?php if ( has_nav_menu( 'social' ) ) : ?>
  72                              <nav id="social-navigation" class="social-navigation" aria-label="<?php esc_attr_e( 'Social Links Menu', 'twentysixteen' ); ?>">
  73                                  <?php
  74                                      wp_nav_menu(
  75                                          array(
  76                                              'theme_location' => 'social',
  77                                              'menu_class'  => 'social-links-menu',
  78                                              'depth'       => 1,
  79                                              'link_before' => '<span class="screen-reader-text">',
  80                                              'link_after'  => '</span>',
  81                                          )
  82                                      );
  83                                  ?>
  84                              </nav><!-- .social-navigation -->
  85                          <?php endif; ?>
  86                      </div><!-- .site-header-menu -->
  87                  <?php endif; ?>
  88              </div><!-- .site-header-main -->
  89  
  90              <?php if ( get_header_image() ) : ?>
  91                  <?php
  92                      /**
  93                       * Filters the default twentysixteen custom header sizes attribute.
  94                       *
  95                       * @since Twenty Sixteen 1.0
  96                       *
  97                       * @param string $custom_header_sizes sizes attribute
  98                       * for Custom Header. Default '(max-width: 709px) 85vw,
  99                       * (max-width: 909px) 81vw, (max-width: 1362px) 88vw, 1200px'.
 100                       */
 101                      $custom_header_sizes = apply_filters( 'twentysixteen_custom_header_sizes', '(max-width: 709px) 85vw, (max-width: 909px) 81vw, (max-width: 1362px) 88vw, 1200px' );
 102                  ?>
 103                  <div class="header-image">
 104                      <a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home">
 105                          <?php
 106                          $custom_header = get_custom_header();
 107                          $attrs         = array(
 108                              'alt'    => get_bloginfo( 'name', 'display' ),
 109                              'sizes'  => $custom_header_sizes,
 110                              'height' => $custom_header->height,
 111                              'width'  => $custom_header->width,
 112                          );
 113  
 114                          the_header_image_tag( $attrs );
 115                          ?>
 116                      </a>
 117                  </div><!-- .header-image -->
 118              <?php endif; // End header image check. ?>
 119          </header><!-- .site-header -->
 120  
 121          <div id="content" class="site-content">


Generated : Sat Dec 21 08:20:01 2024 Cross-referenced by PHPXref