Twenty Ten: Don't use post thumbnail as the custom header if it's smaller than the header size. See #12661. Props iandstewart
git-svn-id: http://svn.automattic.com/wordpress/trunk@13836 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
f16de21ca5
commit
209d4a7a2e
|
@ -34,11 +34,17 @@
|
|||
<div id="site-description"><?php bloginfo( 'description' ); ?></div>
|
||||
|
||||
<?php
|
||||
if ( is_singular() && has_post_thumbnail( $post->ID ) ) :
|
||||
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; ?>
|
||||
// Retrieve the dimensions of the current post thumbnail -- no teensy header images for us!
|
||||
$image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail');
|
||||
list($src, $width, $height) = $image;
|
||||
|
||||
// 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 ) && $width >= 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; ?>
|
||||
</div><!-- #branding -->
|
||||
|
||||
<div id="access">
|
||||
|
|
Loading…
Reference in New Issue