Issue where WP Featured Image will not display

Let’s examine the differences between the working and the not-working code:

  • Working: has_post_thumbnail( $post->ID )
  • Not Working: get_the_post_thumbnail();

The only difference I see is that you’re passing the $postID explicitly to the working function, and not passing it to the non-working function. So, try this:

get_the_post_thumbnail( $post->ID, 'medium' );

You can var_dump() or echo it to verify whether or not you’re getting the correct data returned.

tech