[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

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

   1  <?php
   2  /**
   3   * 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_Ten
   9   * @since Twenty Ten 1.0
  10   */
  11  ?><!DOCTYPE html>
  12  <html <?php language_attributes(); ?>>
  13  <head>
  14  <meta charset="<?php bloginfo( 'charset' ); ?>" />
  15  <title>
  16  <?php
  17      /*
  18       * Print the <title> tag based on what is being viewed.
  19       */
  20      global $page, $paged;
  21  
  22      wp_title( '|', true, 'right' );
  23  
  24      // Add the site name.
  25      bloginfo( 'name' );
  26  
  27      // Add the site description for the home/front page.
  28      $site_description = get_bloginfo( 'description', 'display' );
  29  if ( $site_description && ( is_home() || is_front_page() ) ) {
  30      echo " | $site_description";
  31  }
  32  
  33      // Add a page number if necessary:
  34  if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() ) {
  35      /* translators: %s: Page number. */
  36      echo esc_html( ' | ' . sprintf( __( 'Page %s', 'twentyten' ), max( $paged, $page ) ) );
  37  }
  38  
  39  ?>
  40      </title>
  41  <link rel="profile" href="https://gmpg.org/xfn/11" />
  42  <link rel="stylesheet" type="text/css" media="all" href="<?php echo esc_url( get_stylesheet_uri() ); ?>?ver=20231107" />
  43  <link rel="pingback" href="<?php echo esc_url( get_bloginfo( 'pingback_url' ) ); ?>">
  44  <?php
  45      /*
  46       * We add some JavaScript to pages with the comment form
  47       * to support sites with threaded comments (when in use).
  48       */
  49  if ( is_singular() && get_option( 'thread_comments' ) ) {
  50      wp_enqueue_script( 'comment-reply' );
  51  }
  52  
  53      /*
  54       * Always have wp_head() just before the closing </head>
  55       * tag of your theme, or you will break many plugins, which
  56       * generally use this hook to add elements to <head> such
  57       * as styles, scripts, and meta tags.
  58       */
  59      wp_head();
  60  ?>
  61  </head>
  62  
  63  <body <?php body_class(); ?>>
  64  <?php wp_body_open(); ?>
  65  <div id="wrapper" class="hfeed">
  66      <div id="header">
  67          <div id="masthead">
  68              <div id="branding" role="banner">
  69                  <?php $heading_tag = ( is_home() || is_front_page() ) ? 'h1' : 'div'; ?>
  70                  <<?php echo $heading_tag; ?> id="site-title">
  71                      <span>
  72                          <a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
  73                      </span>
  74                  </<?php echo $heading_tag; ?>>
  75                  <div id="site-description"><?php bloginfo( 'description' ); ?></div>
  76  
  77                  <?php
  78                      // Compatibility with versions of WordPress prior to 3.4.
  79                  if ( function_exists( 'get_custom_header' ) ) {
  80                      /*
  81                       * We need to figure out what the minimum width should be for our featured image.
  82                       * This result would be the suggested width if the theme were to implement flexible widths.
  83                       */
  84                      $header_image_width = get_theme_support( 'custom-header', 'width' );
  85                  } else {
  86                      $header_image_width = HEADER_IMAGE_WIDTH;
  87                  }
  88  
  89                  // Check if this is a post or page, if it has a thumbnail, and if it's a big one.
  90                  $image = false;
  91                  if ( is_singular() && has_post_thumbnail( $post->ID ) ) {
  92                      $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), array( $header_image_width, $header_image_width ) );
  93                  }
  94                  if ( $image && $image[1] >= $header_image_width ) {
  95                      // Houston, we have a new header image!
  96                      echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' );
  97                  } else {
  98                      twentyten_header_image();
  99                  } // End check for featured image or standard header.
 100                  ?>
 101              </div><!-- #branding -->
 102  
 103              <div id="access" role="navigation">
 104                  <?php // Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff. ?>
 105                  <div class="skip-link screen-reader-text"><a href="#content"><?php _e( 'Skip to content', 'twentyten' ); ?></a></div>
 106                  <?php
 107                  /*
 108                   * Our navigation menu. If one isn't filled out, wp_nav_menu() falls back to wp_page_menu().
 109                   * The menu assigned to the primary location is the one used.
 110                   * If one isn't assigned, the menu with the lowest ID is used.
 111                   */
 112                  wp_nav_menu(
 113                      array(
 114                          'container_class' => 'menu-header',
 115                          'theme_location'  => 'primary',
 116                      )
 117                  );
 118                  ?>
 119              </div><!-- #access -->
 120          </div><!-- #masthead -->
 121      </div><!-- #header -->
 122  
 123      <div id="main">


Generated : Mon Mar 18 08:20:01 2024 Cross-referenced by PHPXref