I've added a theme options page to my site (in my functions.php file):
My header.php contains this code, which displays the Featured Image as the banner. If a Featured Image isn't provided it uses the uploaded image banner from the custom image header.
<?php //Custom header // 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 ) && ( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail' )) && $image >= HEADER_IMAGE_WIDTH ) : // We have a new header image! echo get_the_post_thumbnail( $post->ID, 'post-thumbnail', array('usemap' => '#Map') ); else : ?> <img src="<?php header_image(); ?>" alt="<?php bloginfo('name'); ?>" usemap="#Map" /> <?php endif; ?>
My question is, how can I modify this code to output an h1 text header (i.e.
bloginfo('name');) if no banner image has been uploaded (to the site or post)?