]> scripts.mit.edu Git - autoinstalls/wordpress.git/blob - wp-content/themes/twentysixteen/header.php
WordPress 4.4-scripts
[autoinstalls/wordpress.git] / wp-content / themes / twentysixteen / header.php
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">
17         <link rel="profile" href="http://gmpg.org/xfn/11">
18         <?php if ( is_singular() && pings_open( get_queried_object() ) ) : ?>
19         <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
20         <?php endif; ?>
21         <?php wp_head(); ?>
22 </head>
23
24 <body <?php body_class(); ?>>
25 <div id="page" class="site">
26         <div class="site-inner">
27                 <a class="skip-link screen-reader-text" href="#content"><?php _e( 'Skip to content', 'twentysixteen' ); ?></a>
28
29                 <header id="masthead" class="site-header" role="banner">
30                         <div class="site-header-main">
31                                 <div class="site-branding">
32                                         <?php if ( is_front_page() && is_home() ) : ?>
33                                                 <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
34                                         <?php else : ?>
35                                                 <p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
36                                         <?php endif;
37
38                                         $description = get_bloginfo( 'description', 'display' );
39                                         if ( $description || is_customize_preview() ) : ?>
40                                                 <p class="site-description"><?php echo $description; ?></p>
41                                         <?php endif; ?>
42                                 </div><!-- .site-branding -->
43
44                                 <?php if ( has_nav_menu( 'primary' ) || has_nav_menu( 'social' ) ) : ?>
45                                         <button id="menu-toggle" class="menu-toggle"><?php _e( 'Menu', 'twentysixteen' ); ?></button>
46
47                                         <div id="site-header-menu" class="site-header-menu">
48                                                 <?php if ( has_nav_menu( 'primary' ) ) : ?>
49                                                         <nav id="site-navigation" class="main-navigation" role="navigation" aria-label="<?php _e( 'Primary Menu', 'twentysixteen' ); ?>">
50                                                                 <?php
51                                                                         wp_nav_menu( array(
52                                                                                 'theme_location' => 'primary',
53                                                                                 'menu_class'     => 'primary-menu',
54                                                                          ) );
55                                                                 ?>
56                                                         </nav><!-- .main-navigation -->
57                                                 <?php endif; ?>
58
59                                                 <?php if ( has_nav_menu( 'social' ) ) : ?>
60                                                         <nav id="social-navigation" class="social-navigation" role="navigation" aria-label="<?php _e( 'Social Links Menu', 'twentysixteen' ); ?>">
61                                                                 <?php
62                                                                         wp_nav_menu( array(
63                                                                                 'theme_location' => 'social',
64                                                                                 'menu_class'     => 'social-links-menu',
65                                                                                 'depth'          => 1,
66                                                                                 'link_before'    => '<span class="screen-reader-text">',
67                                                                                 'link_after'     => '</span>',
68                                                                         ) );
69                                                                 ?>
70                                                         </nav><!-- .social-navigation -->
71                                                 <?php endif; ?>
72                                         </div><!-- .site-header-menu -->
73                                 <?php endif; ?>
74                         </div><!-- .site-header-main -->
75
76                         <?php if ( get_header_image() ) : ?>
77                                 <?php
78                                         /**
79                                          * Filter the default twentysixteen custom header sizes attribute.
80                                          *
81                                          * @since Twenty Sixteen 1.0
82                                          *
83                                          * @param string $custom_header_sizes sizes attribute
84                                          * for Custom Header. Default '(max-width: 709px) 85vw,
85                                          * (max-width: 909px) 81vw, (max-width: 1362px) 88vw, 1200px'.
86                                          */
87                                         $custom_header_sizes = apply_filters( 'twentysixteen_custom_header_sizes', '(max-width: 709px) 85vw, (max-width: 909px) 81vw, (max-width: 1362px) 88vw, 1200px' );
88                                 ?>
89                                 <div class="header-image">
90                                         <a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home">
91                                                 <img src="<?php header_image(); ?>" srcset="<?php echo esc_attr( wp_get_attachment_image_srcset( get_custom_header()->attachment_id ) ); ?>" sizes="<?php echo esc_attr( $custom_header_sizes ); ?>" 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' ) ); ?>">
92                                         </a>
93                                 </div>
94                         <?php endif; // End header image check. ?>
95                 </header><!-- .site-header -->
96
97                 <div id="content" class="site-content">