Title: Listing Recent Posts
Last modified: August 18, 2016

---

# Listing Recent Posts

 *  [firefox](https://wordpress.org/support/users/firefox/)
 * (@firefox)
 * [20 years, 8 months ago](https://wordpress.org/support/topic/listing-recent-posts/)
 * Hello all
 * I would like to list recent posts (within the same category) in my single.php
   page?
 * for example, if I have a category called “Google”, I would like to list the 5
   recent/prior links to posts that I’ve written about “Google”.
 * I couldn’t find the solution in codex. Anyone know the solution?
 * I know there is a plug-in called “SameCat” that uses this tag:
 * <?php echo list_posts_of_cat(get_the_category(), 5, 5); ?>
 * but i’m still trying to get it to work properly though.
 * thanks

Viewing 1 replies (of 1 total)

 *  [tomhanna](https://wordpress.org/support/users/tomhanna/)
 * (@tomhanna)
 * [20 years, 8 months ago](https://wordpress.org/support/topic/listing-recent-posts/#post-262790)
 * get_the_category only works within The Loop, so that may be your problem. If 
   you want the list to be inside The Loop you can probably do it, but if you’re
   trying for a list of recent posts in the sidebar, I don’t see a way to manage
   it.

Viewing 1 replies (of 1 total)

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

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [tomhanna](https://wordpress.org/support/users/tomhanna/)
 * Last activity: [20 years, 8 months ago](https://wordpress.org/support/topic/listing-recent-posts/#post-262790)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
