Title: get_posts() &#8211; post list ordered by post category
Last modified: August 18, 2016

---

# get_posts() – post list ordered by post category

 *  [koala22](https://wordpress.org/support/users/koala22/)
 * (@koala22)
 * [18 years, 5 months ago](https://wordpress.org/support/topic/get_posts-post-list-ordered-by-post-category/)
 * Hi,
 * I would like to generate a list of ALL my posts, ordered by category. The code
   I tried to use is this, but it doesn’t sort the posts by category:
 *  $myposts = get_posts(‘numberposts=999&orderby=post_category’);
 * Can anyone help?
    Thanks!

The topic ‘get_posts() – post list ordered by post category’ is closed to new replies.

## Tags

 * [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: [koala22](https://wordpress.org/support/users/koala22/)
 * Last activity: [18 years, 5 months ago](https://wordpress.org/support/topic/get_posts-post-list-ordered-by-post-category/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
