Title: Listing recent post_thumbnails
Last modified: August 19, 2016

---

# Listing recent post_thumbnails

 *  [alex-fever](https://wordpress.org/support/users/alex-fever/)
 * (@alex-fever)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/listing-recent-post_thumbnails/)
 * Hi everyone – I’m trying to list the most recent posts with their corresponding
   post_thumbnails() images… I got it working with:
 *     ```
       <div class="recent_thumbs">
       <h1>Posts you might have missed</h1>
       <?php
       global $post;
       $the_newest = get_posts('numberposts=8');
        ?>
       <?php foreach($the_newest as $post) :
       setup_postdata($post);	?>
       <div class="post">
       <div class="recent_thumbs_image"><a href="<?php the_permalink() ?>"><?php the_post_thumbnail('list-post-thumbnail'); ?></a></div>
       <h2 class="posttitle"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
   
       </div>
       <?php endforeach; ?>
   
       </div>
       ```
   
 * But now the comments for each post (i’m calling them from the sidebar.php template)
   are the same!
 * Is there any other way to list the recent post_thumbnails in the format i’ve 
   defined in functions.php?
 * Any help much appreciated!
 * -Alex

The topic ‘Listing recent post_thumbnails’ is closed to new replies.

## Tags

 * [the-loop](https://wordpress.org/support/topic-tag/the-loop/)

 * 0 replies
 * 1 participant
 * Last reply from: [alex-fever](https://wordpress.org/support/users/alex-fever/)
 * Last activity: [15 years, 10 months ago](https://wordpress.org/support/topic/listing-recent-post_thumbnails/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
