[wp-trac] [WordPress Trac] #12661: In TwentyTen Theme, use of Post Thumbnail in Content Area instead of as Header Replacement

WordPress Trac wp-trac at lists.automattic.com
Mon Apr 5 02:41:15 UTC 2010


#12661: In TwentyTen Theme, use of Post Thumbnail in Content Area instead of as
Header Replacement
--------------------------+-------------------------------------------------
 Reporter:  mikeschinkel  |        Owner:  iammattthomas
     Type:  defect (bug)  |       Status:  reopened     
 Priority:  normal        |    Milestone:  3.0          
Component:  Themes        |      Version:  3.0          
 Severity:  normal        |   Resolution:               
 Keywords:                |  
--------------------------+-------------------------------------------------

Comment(by dd32):

 {{{
                                 <?php
                                         // Check if this is a post or
 page, if it has a thumbnail, and if it's a big one
                                         if ( is_singular() &&
 has_post_thumbnail( $post->ID ) && ( /* $src, $width, $height */ $image =
 wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-
 thumbnail')) && $image[1] >= HEADER_IMAGE_WIDTH ) :
                                                 // Houston, we have a new
 header image!
                                                 echo
 get_the_post_thumbnail( $post->ID, 'post-thumbnail' );
                                         else : ?>
                                                 <img src="<?php
 header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>"
 height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="" />
                                         <?php endif; ?>
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/12661#comment:9>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list