I believe you can fetch that data using setup_postdata() which lets you access all the data relating to a post and use it with standard template tags (in your case, the_post_thumbnail).
There is a great tutorial here:
https://wpshout.com/setup_postdata-template-tags-need-custom-wp_post-arrays-crave/
Important to note that you first have to setup the global $post and you have to be sure to reset using wp_reset_postdata at the end of your query.
I hope this works for you!
Related Posts:
- What is best way passing variables to theme templates and using them different places like widgets?
- get_the_foo() in the loop – does it perform another query?
- WP Loop. If featured image is a panorama (3:1 ratio) execute some code
- Pulling in featured image into default recent posts widget
- Closing the loop…featured image variable based on post id
- WordPress get post thumbnail url
- How to output thumbnail twice in a loop
- Default featured image set as background image [closed]
- How can I access a post’s feature image outside the loop?
- How to check all items in a loop have post thumbnail?
- Thumbnail Image Rounded Corners w CSS (or any other good method)
- wp_get_attachment_url not fetching URL?
- Thumbnail of the latest posts page
- Pages with a loop (index, archive) are loading the first image as post_thumbnail
- Display Featured Image
- Place the Featured image on a post, before the first via code
- remove tags from the_content
- the_title() shows title of the first post instead of the page title?
- How to place comments_template(); outside the loop?
- How do I prevent one of two multiple loops from repeating on a second page?
- What exactly defines a Main Loop and a Secondary Loop?
- Loop code is displaying pages but not actual posts
- How are both HTTP and HTTPS versions displaying?
- Ajax loop refresh on click
- How do you split multiple-column loop on category archive page?
- How to Loop within a Loop (Display Children and then Grandchildren)
- the_excerpt(), get_the_excerpt() and the_content() all killing “the Loop”
- Is get_posts() more efficient than The Loop?
- loop through all posts memory error
- How to loop through ALL pages?
- Does get_template_part pull data once in a loop?
- Get titles of all posts with current tags except current post
- Creating a multi-taxonomy query, excluding the newest (read: highest ID) taxonomy term
- Show a different post every 3 days [duplicate]
- Targeting a Certain Post in Loop (CSS)
- Using get_the_excerpt() Before The Loop
- Display most viewed post from last 30 days is not working correctly
- WP_Query condition affects posts_per_page count
- What is the maximum number of posts a WordPress loop can work with?
- wp_query inside the_loop
- How to go about combining dropdowns / filter queries?
- Split loop to load WordPress gallery into Bootstrap modal and carousel
- How do I use AJAX Query in my posts loop?
- How to show “teaser” posts on blog / archive pages, otherwise full posts
- Duplicate posts in paginated results
- Output loop leveraged shortcode twice on one page
- Alter query using pre_get_posts() if meta_key is present
- Next Posts Prev Posts for Standard post format only
- Genesis multiple category custom loop 404s after first page
- Shortcode in posts called by ajax is not working
- Using Javascript for Looped Content
- Added if statement to loop
- How to get The Loop working with $wpdb->get_results()
- Making a query to the DB using same parameters of loop
- Variable not being passed into WordPress loop
- Exclude duplicated $sticky post from combined loop content
- Group posts by date with a list
- Add class to last 3 posts in loop
- Will only show the first 10 wordpress posts instead of all my posts
- Trying to get property of non-object in shortocde
- displaying recent comments outside loop without plugin
- get_the_ID not returning correct ID value
- Tags on page (not post) returns nothing – why? Improved clarified question!
- Include future posts in tags and in search
- loop inside the foreach
- How to display 3 post per slide
- How to put a block of code between [shortcode][/shortcode] in do_shortcode()?
- current-user_can not working in loop
- Show terms in archive page
- Multiple loops for plugin
- Sort posts according to a numeric value entered with ACF
- Undefined index: page in loop load ajax content
- Only Show Excerpt After First 3 Posts
- How to get all multi-select user meta values and add them to an array?
- How to insert content before pagination in loop?
- How to resolve a reload loop issue in the frontend when logged in to WordPress multi-site backend admin area
- Excerpt isn’t working or am I missing something?
- Can I temporarily disable global $post?
- Shortcode for pulling specific Post Title outside loop when ID is passed in
- Deeply Nested Menu Loop with Twig using Timber [closed]
- WordPress redundant posts based on meta field
- Get featured image outside the loop using foreach
- Infinite Loop after Genesis Theme Upgrade
- pre_get_posts main_query not displaying after applying tax_query filters
- WordPress loop only displays 5 articles max?
- setup_postdata in “loop-handling” php file called via $.ajax
- Secondary loop cuts off at 10 posts?
- How to display thumbnail if post is assigned one otherwise not
- get all page templates
- Paged homepage – requirements?
- Least Number of Loops to Create Custom Homepage?
- The Loop for my theme with static front page is not working
- strange parse error when including a loop template within another template
- Previous Posts Link and Next Posts Link Show All The Same Articles?
- Posts Loops To Display Specific Posts Inside Page Template?
- Use callback function in AJAX pure javascript [closed]
- Undefined variable: woocommerce_loop [closed]
- title not being printed within html tag [closed]
- Prevent duplicating specific column from database table
- Use Base-URL with Query-Loop