• 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.

    <?php
    
                    // 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() ) {
    
                        dynamic_sidebar('banner-widget');
    
                    // no featured image set
                    } else {
                        echo '<img src="https://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 topic ‘Why is my post's featured image applying to my my blog page too?’ is closed to new replies.