Changeset 13836
- Timestamp:
- 03/27/2010 01:59:46 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-content/themes/twentyten/header.php
r13830 r13836 35 35 36 36 <?php 37 if ( is_singular() && has_post_thumbnail( $post->ID ) ) : 38 echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' ); 39 else : ?> 40 <img src="<?php header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="" /> 41 <?php endif; ?> 37 // Retrieve the dimensions of the current post thumbnail -- no teensy header images for us! 38 $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail'); 39 list($src, $width, $height) = $image; 40 41 // Check if this is a post or page, if it has a thumbnail, and if it's a big one 42 if ( is_singular() && has_post_thumbnail( $post->ID ) && $width >= HEADER_IMAGE_WIDTH ) : 43 // Houston, we have a new header image! 44 echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' ); 45 else : ?> 46 <img src="<?php header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="" /> 47 <?php endif; ?> 42 48 </div><!-- #branding --> 43 49
Note: See TracChangeset
for help on using the changeset viewer.