[ Index ] |
PHP Cross Reference of WordPress |
[Summary view] [Print] [Text view]
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 blog name. 25 bloginfo( 'name' ); 26 27 // Add the blog 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 bloginfo( 'stylesheet_url' ); ?>?ver=20190507" /> 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( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" 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 // Compatibility with versions of WordPress prior to 3.4. 99 if ( function_exists( 'get_custom_header' ) ) { 100 $header_image_width = get_custom_header()->width; 101 $header_image_height = get_custom_header()->height; 102 } else { 103 $header_image_width = HEADER_IMAGE_WIDTH; 104 $header_image_height = HEADER_IMAGE_HEIGHT; 105 } 106 ?> 107 <img src="<?php header_image(); ?>" width="<?php echo esc_attr( $header_image_width ); ?>" height="<?php echo esc_attr( $header_image_height ); ?>" alt="" /> 108 <?php 109 } // End check for featured image or standard header. 110 ?> 111 </div><!-- #branding --> 112 113 <div id="access" role="navigation"> 114 <?php // Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff. ?> 115 <div class="skip-link screen-reader-text"><a href="#content" title="<?php esc_attr_e( 'Skip to content', 'twentyten' ); ?>"><?php _e( 'Skip to content', 'twentyten' ); ?></a></div> 116 <?php 117 /* 118 * Our navigation menu. If one isn't filled out, wp_nav_menu() falls back to wp_page_menu(). 119 * The menu assigned to the primary location is the one used. 120 * If one isn't assigned, the menu with the lowest ID is used. 121 */ 122 wp_nav_menu( 123 array( 124 'container_class' => 'menu-header', 125 'theme_location' => 'primary', 126 ) 127 ); 128 ?> 129 </div><!-- #access --> 130 </div><!-- #masthead --> 131 </div><!-- #header --> 132 133 <div id="main">
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Thu Nov 21 01:00:03 2024 | Cross-referenced by PHPXref 0.7.1 |