[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

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

   1  <?php
   2  /**
   3   * The Header template for our theme
   4   *
   5   * Displays all of the <head> section and everything up till <div id="main">
   6   *
   7   * @package WordPress
   8   * @subpackage Twenty_Twelve
   9   * @since Twenty Twelve 1.0
  10   */
  11  ?><!DOCTYPE html>
  12  <html <?php language_attributes(); ?>>
  13  <head>
  14  <meta charset="<?php bloginfo( 'charset' ); ?>" />
  15  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  16  <title><?php wp_title( '|', true, 'right' ); ?></title>
  17  <link rel="profile" href="https://gmpg.org/xfn/11" />
  18  <link rel="pingback" href="<?php echo esc_url( get_bloginfo( 'pingback_url' ) ); ?>">
  19  <?php wp_head(); ?>
  20  </head>
  21  
  22  <body <?php body_class(); ?>>
  23  <?php wp_body_open(); ?>
  24  <div id="page" class="hfeed site">
  25      <a class="screen-reader-text skip-link" href="#content"><?php _e( 'Skip to content', 'twentytwelve' ); ?></a>
  26      <header id="masthead" class="site-header">
  27          <hgroup>
  28              <?php
  29              $is_front         = ! is_paged() && ( is_front_page() || ( is_home() && ( (int) get_option( 'page_for_posts' ) !== get_queried_object_id() ) ) );
  30              $site_name        = get_bloginfo( 'name', 'display' );
  31              $site_description = get_bloginfo( 'description', 'display' );
  32  
  33              if ( $site_name ) :
  34                  ?>
  35                  <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home" <?php echo $is_front ? 'aria-current="page"' : ''; ?>><?php echo $site_name; ?></a></h1>
  36                  <?php
  37              endif;
  38  
  39              if ( $site_description ) :
  40                  ?>
  41                  <h2 class="site-description"><?php echo $site_description; ?></h2>
  42              <?php endif; ?>
  43          </hgroup>
  44  
  45          <nav id="site-navigation" class="main-navigation">
  46              <button class="menu-toggle"><?php _e( 'Menu', 'twentytwelve' ); ?></button>
  47              <?php
  48              wp_nav_menu(
  49                  array(
  50                      'theme_location' => 'primary',
  51                      'menu_class'     => 'nav-menu',
  52                  )
  53              );
  54              ?>
  55          </nav><!-- #site-navigation -->
  56  
  57          <?php if ( get_header_image() ) : ?>
  58          <a href="<?php echo esc_url( home_url( '/' ) ); ?>" <?php echo $is_front ? 'aria-current="page"' : ''; ?> rel="home"><?php twentytwelve_header_image(); ?></a>
  59          <?php endif; ?>
  60      </header><!-- #masthead -->
  61  
  62      <div id="main" class="wrapper">


Generated : Thu Oct 30 08:20:06 2025 Cross-referenced by PHPXref