From 007a50a14a954f76ea820097be3b68bad45534a0 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Mon, 5 Apr 2010 02:58:39 +0000 Subject: [PATCH] Move all Feature Images => header image integration into a is_singular() check. Prevents a PHP notice when $post is not set (For example, a 404 page). Fixes #12661 git-svn-id: https://develop.svn.wordpress.org/trunk@14002 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-content/themes/twentyten/header.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/wp-content/themes/twentyten/header.php b/wp-content/themes/twentyten/header.php index 29d768fbce..00f81c8f0a 100644 --- a/wp-content/themes/twentyten/header.php +++ b/wp-content/themes/twentyten/header.php @@ -44,19 +44,18 @@

- +
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 ) : + 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 : ?>