[ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[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 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=20250415" /> 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 <?php // Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff. ?> 67 <a href="#content" class="screen-reader-text skip-link"><?php _e( 'Skip to content', 'twentyten' ); ?></a> 68 <div id="header"> 69 <div id="masthead"> 70 <div id="branding" role="banner"> 71 <?php 72 $heading_tag = ( is_home() || is_front_page() ) ? 'h1' : 'div'; 73 $is_front = ! is_paged() && ( is_front_page() || ( is_home() && ( (int) get_option( 'page_for_posts' ) !== get_queried_object_id() ) ) ); 74 $site_name = get_bloginfo( 'name', 'display' ); 75 $site_description = get_bloginfo( 'description', 'display' ); 76 77 if ( $site_name ) : 78 ?> 79 <<?php echo $heading_tag; ?> id="site-title"> 80 <span> 81 <a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home" <?php echo $is_front ? 'aria-current="page"' : ''; ?>><?php echo $site_name; ?></a> 82 </span> 83 </<?php echo $heading_tag; ?>> 84 <?php 85 endif; 86 87 if ( $site_description ) : 88 ?> 89 <div id="site-description"><?php echo $site_description; ?></div> 90 <?php 91 endif; 92 93 // Compatibility with versions of WordPress prior to 3.4. 94 if ( function_exists( 'get_custom_header' ) ) { 95 /* 96 * We need to figure out what the minimum width should be for our featured image. 97 * This result would be the suggested width if the theme were to implement flexible widths. 98 */ 99 $header_image_width = get_theme_support( 'custom-header', 'width' ); 100 } else { 101 $header_image_width = HEADER_IMAGE_WIDTH; 102 } 103 104 // Check if this is a post or page, if it has a thumbnail, and if it's a big one. 105 $image = false; 106 if ( is_singular() && has_post_thumbnail( $post->ID ) ) { 107 $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), array( $header_image_width, $header_image_width ) ); 108 } 109 if ( $image && $image[1] >= $header_image_width ) { 110 // Houston, we have a new header image! 111 echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' ); 112 } else { 113 twentyten_header_image(); 114 } // End check for featured image or standard header. 115 ?> 116 </div><!-- #branding --> 117 118 <div id="access" role="navigation"> 119 <?php 120 /* 121 * Our navigation menu. If one isn't filled out, wp_nav_menu() falls back to wp_page_menu(). 122 * The menu assigned to the primary location is the one used. 123 * If one isn't assigned, the menu with the lowest ID is used. 124 */ 125 wp_nav_menu( 126 array( 127 'container_class' => 'menu-header', 128 'theme_location' => 'primary', 129 ) 130 ); 131 ?> 132 </div><!-- #access --> 133 </div><!-- #masthead --> 134 </div><!-- #header --> 135 136 <div id="main">
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated : Sat Jul 26 08:20:01 2025 | Cross-referenced by PHPXref |