- File:
-
- 1 edited
-
trunk/wp-content/themes/twentyten/header.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-content/themes/twentyten/header.php
r17300 r20983 67 67 68 68 <?php 69 // Compatibility with versions of WordPress prior to 3.4. 70 if ( function_exists( 'get_custom_header' ) ) { 71 // We need to figure out what the minimum width should be for our featured image. 72 // This result would be the suggested width if the theme were to implement flexible widths. 73 $header_image_width = get_theme_support( 'custom-header', 'width' ); 74 } else { 75 $header_image_width = HEADER_IMAGE_WIDTH; 76 } 77 69 78 // Check if this is a post or page, if it has a thumbnail, and if it's a big one 70 79 if ( is_singular() && current_theme_supports( 'post-thumbnails' ) && 71 80 has_post_thumbnail( $post->ID ) && 72 81 ( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail' ) ) && 73 $image[1] >= HEADER_IMAGE_WIDTH) :82 $image[1] >= $header_image_width ) : 74 83 // Houston, we have a new header image! 75 84 echo get_the_post_thumbnail( $post->ID ); 76 elseif ( get_header_image() ) : ?> 77 <img src="<?php header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="" /> 85 elseif ( get_header_image() ) : 86 // Compatibility with versions of WordPress prior to 3.4. 87 if ( function_exists( 'get_custom_header' ) ) { 88 $header_image_width = get_custom_header()->width; 89 $header_image_height = get_custom_header()->height; 90 } else { 91 $header_image_width = HEADER_IMAGE_WIDTH; 92 $header_image_height = HEADER_IMAGE_HEIGHT; 93 } 94 ?> 95 <img src="<?php header_image(); ?>" width="<?php echo $header_image_width; ?>" height="<?php echo $header_image_height; ?>" alt="" /> 78 96 <?php endif; ?> 79 97 </div><!-- #branding --> 80 98 81 99 <div id="access" role="navigation"> 82 <?php /* Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff */ ?>100 <?php /* Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff */ ?> 83 101 <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> 84 <?php /* Our navigation menu. If one isn't filled out, wp_nav_menu falls back to wp_page_menu. The menu assiged to the primary position is the one used. If none is assigned, the menu with the lowest ID is used.*/ ?>102 <?php /* Our navigation menu. If one isn't filled out, wp_nav_menu falls back to wp_page_menu. The menu assiged to the primary position is the one used. If none is assigned, the menu with the lowest ID is used. */ ?> 85 103 <?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary' ) ); ?> 86 104 </div><!-- #access -->
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)