Changeset 20983 for trunk/wp-content/themes/twentyten/header.php
- Timestamp:
- 06/04/2012 02:43:19 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-content/themes/twentyten/header.php
r20474 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] >= get_theme_support( 'custom-header', '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() ) : 85 elseif ( get_header_image() ) : 86 // Compatibility with versions of WordPress prior to 3.4. 77 87 if ( function_exists( 'get_custom_header' ) ) { 78 $header_ width = get_custom_header()->width;79 $header_ height = get_custom_header()->height;88 $header_image_width = get_custom_header()->width; 89 $header_image_height = get_custom_header()->height; 80 90 } else { 81 $header_height = $header_width = ''; 91 $header_image_width = HEADER_IMAGE_WIDTH; 92 $header_image_height = HEADER_IMAGE_HEIGHT; 82 93 } 83 84 <img src="<?php header_image(); ?>" width="<?php echo $header_ width; ?>" height="<?php echo $header_height; ?>" alt="" />94 ?> 95 <img src="<?php header_image(); ?>" width="<?php echo $header_image_width; ?>" height="<?php echo $header_image_height; ?>" alt="" /> 85 96 <?php endif; ?> 86 97 </div><!-- #branding -->
Note: See TracChangeset
for help on using the changeset viewer.