Opened 3 years ago

Last modified 19 months ago

#14478 new enhancement

Allow explicit ordering of included posts in query_posts

Reported by: daltonrooney Owned by:
Priority: normal Milestone: Future Release
Component: Query Version:
Severity: normal Keywords:
Cc:

Description

This is in reference to ticket #9819

I think it would be useful to add an extra orderby value to query_posts that could return posts based on the order they are listed.

So when you do query_posts("include=3,2,5,4,1&orderby=given")

They should be returned in the order 3,2,5,4,1

As mentioned by @dd32 in the previously referenced ticket, orderby=none returns the posts in MySQL Natural order, which is by ID.

Change History (2)

  • Milestone changed from Awaiting Review to Future Release

Would it be better to name this 'orderby=include' to make it clear the source of the sort order is from the 'include' parameter?

So, it would be something like: query_posts("include=3,2,5,4,1&orderby=include")

Note: See TracTickets for help on using tickets.