Custom Loop, Match Category with Page: How to display post featured image?
get_posts fetches an array of WP_Post objects (see the return values of get_post for a complete list of object properties). In your above code snippet, you are iterating over said array with a foreach loop. Inside it, you are currently attempting to use a non-existent method ( post_thumbnail() ) of those objects. Instead, make use … Read more