I'm just looking to make sure my home page and pages display my featured image if set, and other wise if not set show blog-banner.jpg. So that's what I thought I had however now my 404 error page doesn't have a banner image. Any advice on correcting this if statement?
/** Add the featured image section */
add_action( 'genesis_before_header', 'minimum_featured_image' );
function minimum_featured_image() {
global $post;
$post->ID;
if ( is_home() ) {
echo '<div id="featured-image-home">';
echo get_the_post_thumbnail($thumbnail->ID, 'header');
echo '</div>';
}
if ( is_singular( array( 'post' ) ) && ( !has_post_thumbnail( $post->ID ) ) ){
echo '<div id="featured-image-home"><img src="'. get_stylesheet_directory_uri() . '/images/blog-banner.jpg" /></div>';
return;
}
if ( is_singular( array( 'post', 'page' ) ) && has_post_thumbnail( $post->ID ) ){
echo '<div id="featured-image">';
echo get_the_post_thumbnail($thumbnail->ID, 'header');
echo '</div>';
}
}