From 12bf157d330d69bb71b50510218cf02bd9be28f0 Mon Sep 17 00:00:00 2001 From: Robin Cornett Date: Tue, 18 Nov 2014 21:00:56 -0500 Subject: [PATCH] photon metadata fix --- includes/class-displayfeaturedimagegenesis-common.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/includes/class-displayfeaturedimagegenesis-common.php b/includes/class-displayfeaturedimagegenesis-common.php index 4726853..65f5726 100644 --- a/includes/class-displayfeaturedimagegenesis-common.php +++ b/includes/class-displayfeaturedimagegenesis-common.php @@ -33,9 +33,11 @@ class Display_Featured_Image_Genesis_Common { $postspage_image = get_post_thumbnail_id( $postspage ); if ( is_singular() ) { // just checking for handling conditional variables set by width - $thumbnail_id = get_post_thumbnail_id( $post->ID ); - $metadata = wp_get_attachment_metadata( $thumbnail_id ); // needed only for the next line - $width = $metadata['width']; + $thumb_metadata = wp_get_attachment_metadata( get_post_thumbnail_id( $post->ID ) ); // needed only for the next line + $width = ''; + if ( $thumb_metadata ) { + $width = $thumb_metadata['width']; + } } // sitewide variables used outside this function