From 209d4a7a2e4c434a2aabf0a928ece6560f209752 Mon Sep 17 00:00:00 2001 From: iammattthomas Date: Sat, 27 Mar 2010 01:59:46 +0000 Subject: [PATCH] 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 --- wp-content/themes/twentyten/header.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/wp-content/themes/twentyten/header.php b/wp-content/themes/twentyten/header.php index 854841c792..3ab1e2b4d2 100644 --- a/wp-content/themes/twentyten/header.php +++ b/wp-content/themes/twentyten/header.php @@ -34,11 +34,17 @@
ID ) ) : - echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' ); - else : ?> - - + // 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 : ?> + +