Title: Retrieving category specific posts
Last modified: August 19, 2016

---

# Retrieving category specific posts

 *  [jwbernin](https://wordpress.org/support/users/jwbernin/)
 * (@jwbernin)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/retrieving-category-specific-posts/)
 * I’m attempting to retrieve posts only from a specific category via a get_posts()
   call, but I am retrieving posts from other categories from this call. I’ve got
   the call as follows:
 * `$lastposts = get_posts('category=general');`
 * How do I format the call so as to retrieve only the posts from the given category–
   and to retrieve no posts at all if there are no posts in that category?

The topic ‘Retrieving category specific posts’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [jwbernin](https://wordpress.org/support/users/jwbernin/)
 * Last activity: [16 years, 2 months ago](https://wordpress.org/support/topic/retrieving-category-specific-posts/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
