Title: Recent Posts with Excerpt
Last modified: August 19, 2016

---

# Recent Posts with Excerpt

 *  [jpmaximilian](https://wordpress.org/support/users/jpmaximilian/)
 * (@jpmaximilian)
 * [17 years, 1 month ago](https://wordpress.org/support/topic/recent-posts-with-excerpt-2/)
 * I use the code: <?php wp_get_archives(‘type=postbypost&limit=4’); ?> to list 
   the 4 most recent posts, but I’d also like to be able to list the excerpt after
   each post. Is there a way to do this and if so, how? Any help is appreciated.

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [jrscott](https://wordpress.org/support/users/jrscott/)
 * (@jrscott)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/recent-posts-with-excerpt-2/#post-1022876)
 * I would also like to know how to do this. If anyone knows a simple way it would
   be much appreciated
 * cheers,
 *  [RGlover](https://wordpress.org/support/users/rglover/)
 * (@rglover)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/recent-posts-with-excerpt-2/#post-1022877)
 * I think the best way to do it would be, instead, to use a WP_Query object to 
   create a secondary loop on the page. Something like this:
 *     ```
       <?php
       $recent = new WP_Query();
       $recent->query('showposts=4');
       if($recent->have_posts()) : while($recent->have_posts()): $recent->the_post();
       ?>
       <!--whatever html structure you want to put here to get the_title() the_permalink() and the_excerpt() for each of the members of $recent->the_post()-->
       <?php endwhile ?>
       <?php else : ?>
       <p> Nothing to see here. Move along </p>
       <?php endif ?>
       ```
   
 * That’s how I’d do it.
 *  [matt-keefe](https://wordpress.org/support/users/matt-keefe/)
 * (@matt-keefe)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/recent-posts-with-excerpt-2/#post-1022881)
 * Hi guys. I’m using this method, but I’m getting some strange results. The date
   is appearing only on the first entry retrieved (you can see it here – [http://www.mattkeefe.com/living_static/](http://www.mattkeefe.com/living_static/)–
   second block down the sidebar). Why would this be the case? Do I need to move
   my `<ul>` and `<li>` tags? My PHP is below. Cheers.
 * >     ```
   >     <div id="recent_posts">
   > 
   >     						<h3>Recent Posts</h3>
   >     						<ul class="posts">
   >     <?php
   >     $recent = new WP_Query();
   >     $recent->query('showposts=4');
   >     if($recent->have_posts()) : while($recent->have_posts()): $recent->the_post();
   >     ?><li>
   >     <a href="<?php the_permalink()?>"><?php the_title()?></a><?php the_excerpt()?><?php the_date()?></li>
   >     <?php endwhile ?>
   >     <?php else : ?>
   >     <?php endif ?>
   > 
   >     </ul>
   > 
   >     </div>
   >     ```
   > 
 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/recent-posts-with-excerpt-2/#post-1022882)
 * Use the [template tag](http://codex.wordpress.org/Template_Tags), [the_time()](http://codex.wordpress.org/Template_Tags/the_time),
   instead of [the_date()](http://codex.wordpress.org/Template_Tags/the_date).

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Recent Posts with Excerpt’ is closed to new replies.

## Tags

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

 * 4 replies
 * 5 participants
 * Last reply from: [MichaelH](https://wordpress.org/support/users/michaelh/)
 * Last activity: [16 years, 8 months ago](https://wordpress.org/support/topic/recent-posts-with-excerpt-2/#post-1022882)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
