WordPress.org

Ready to get started?Download WordPress

Forums

Featured Image on Blog Page uses the latest blog post's featured image (1 post)

  1. pcandtheweb
    Member
    Posted 8 months ago #

    Hello all,

    My blog page uses the featured image from the latest blog post and not the blog page itself. I have the Reading settings set to make the list of posts appear on the blog page. On all other pages the featured image works fine. It's only the blog page where this is happening. Any help would be much appreciated. This is my first time using the forums, but I've used them many times in the past to solve issues I was having. My code for the header image is below -

    <?php if ( is_front_page() ) {
    
    	//Nothing
    
    	} 
    
    	else {
    		// Start the image area
    		echo '<section id="pageImage"><div class="row">';
    		if ( has_post_thumbnail() ) {
    	    the_post_thumbnail();
                                        }
    
    		else { echo "<img src=\"";
    							echo get_template_directory_uri();
    							echo "/images/generic.gif";
                                echo "\" alt=\"Generic Image\"/>";
    			  }
    			  // Close out the image area
    							echo '<div class="headline"><h2>';
    							echo the_title();
    							echo '</h2></div><div class="clear"></div></div></section>';
    
    			  } 
    
    		?>

Reply

You must log in to post.

About this Topic