This is my first wordpress website here and so far it'll looking good. The only thing I have left that I just can't figure out is the featured image for my blog page. I have set the main blog banner to a default featured image that's hard coded into the header.php file (and my blog page does not have a featured image so it usually shows the default like i should), which looks like this.


                // Check to see if we're on a non-home-page and if the non-home-page has a featured image.
                if( !is_front_page() && has_post_thumbnail() ) {

                    the_post_thumbnail( '960, 403' );

                // if we're on the home page 
                } elseif ( function_exists('dynamic_sidebar') && is_dynamic_sidebar('banner-widget') && is_front_page() ) {


                // no featured image set
                } else {
                    echo '<img src="http://www.averylawoffice.ca/Avery-Banner-Default.jpg" alt="Avery Law Office | Summerland, BC">';

Which was working fine. Now I'm trying to set individual featured banners for each post but the minute I set one for the newest post the banner on the main blog page changes to that one. However all other later posts do what I want them to do. Is there something in the header I should change or have to set in single.php that I might be missing? If you need to see a specific code please let me know. I wasn't sure what page/code to show so I started with the header conditional tag. Any help or advice is appreciated as always!


The code you have there should work based on the following assumptions

  1. You have set a thumbnail for each post
  2. You have enabled thumbnails
  3. You are calling that from within the loop

If you haven't done any one of those things you should be getting your default image. But that's just with a cursory glance at your code, and I could be wrong on that.

  • That I know I've done all that. However not 100% sure where else to look. I'll just have to deal with it. It's not that bad.
    – kia4567
    Jun 8 '12 at 17:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.