Title: get_posts() returning posts in odd order
Last modified: August 19, 2016

---

# get_posts() returning posts in odd order

 *  [mojoman](https://wordpress.org/support/users/mojoman/)
 * (@mojoman)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/get_posts-returning-posts-in-odd-order/)
 * Hi all,
 * I’m having a bit of a problem with a simple get_posts() request in the sidebar.
   php of my theme.
 * I’m using the following code taken directly from the codex:
 * `$postslist = get_posts('numberposts=10&order=ASC&orderby=title');`
 * This does indeed return all 6 actual posts but not in ascending date order as
   expected. The latest test post I have slotted in should be at the top but actually
   appears sixth on the list. I’ve checked the other posts’ published dates and 
   there seems to be no issue there – The dates are correct. I thought it might 
   be to do with the ID but that doesn’t seem t be the case either.
 * The order that the posts are returned in is as follows (ID / post date):
 * 194 | August 27, 2010
    350 | August 15, 2010 372 | August 26, 2010 343 | June
   6, 2010 357 | August 1, 2010 480 | September 10, 2010
 * As you can see the the posts aren’t even in date order. Can anyone shed any light
   on what might be happening here?
 * Thanks for any help in advance
    Dan

Viewing 1 replies (of 1 total)

 *  [vtxyzzy](https://wordpress.org/support/users/vtxyzzy/)
 * (@vtxyzzy)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/get_posts-returning-posts-in-odd-order/#post-1667350)
 * You have an ‘orderby=title’ parameter in your query, so the posts should be in
   order by title. Give this a try:
 * `$postslist = get_posts('numberposts=10&order=ASC');`

Viewing 1 replies (of 1 total)

The topic ‘get_posts() returning posts in odd order’ 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/)
 * 1 reply
 * 2 participants
 * Last reply from: [vtxyzzy](https://wordpress.org/support/users/vtxyzzy/)
 * Last activity: [15 years, 9 months ago](https://wordpress.org/support/topic/get_posts-returning-posts-in-odd-order/#post-1667350)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
