Changeset 45581 for trunk/src/wp-content/themes/twentyeleven/header.php
- Timestamp:
- 07/01/2019 08:22:31 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-content/themes/twentyeleven/header.php
r45218 r45581 103 103 * Check if this is a post or page, if it has a thumbnail, and if it's a big one 104 104 */ 105 if ( is_singular() && has_post_thumbnail( $post->ID ) && 106 ( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), array( $header_image_width, $header_image_width ) ) ) && 107 $image[1] >= $header_image_width ) : 108 // Houston, we have a new header image! 109 echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' ); 110 else : 105 if ( is_singular() && has_post_thumbnail( $post->ID ) ) { 106 $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), array( $header_image_width, $header_image_width ) ); 107 if ( $image && $image[1] >= $header_image_width ) { 108 // Houston, we have a new header image! 109 echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' ); 110 } 111 } else { 111 112 // Compatibility with versions of WordPress prior to 3.4. 112 113 if ( function_exists( 'get_custom_header' ) ) { … … 119 120 ?> 120 121 <img src="<?php header_image(); ?>" width="<?php echo esc_attr( $header_image_width ); ?>" height="<?php echo esc_attr( $header_image_height ); ?>" alt="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" /> 121 <?php endif; // end check for featured image or standard header ?> 122 <?php 123 } // end check for featured image or standard header 124 ?> 122 125 </a> 123 126 <?php endif; // end check for removed header image ?>
Note: See TracChangeset
for help on using the changeset viewer.