[wp-hackers] Order by +/- ?

Andy Skelton skeltoac at gmail.com
Thu Feb 2 14:31:56 GMT 2006

On 2/2/06, Danny Ayers <danny.ayers at gmail.com> wrote:
> Apologies, this is a bit of newbie-user question, but it came to mind
> while musing on feed provision issues, so hopefully not too off-topic
> for dev.

Nah :)

> Are there currently any method/arguments in place to flip the
> chronological (or other) order of items etc returned? i.e. something
> that wraps ...ORDER BY ASC/DESC

On line 651 of classes.php:
$orderby = apply_filters('posts_orderby', $orderby);
You can use that filter to modify the query.

On line 689 of classes.php:
$this->posts = apply_filters('the_posts', $this->posts);
You can use this to sort the posts any way you like.


More information about the wp-hackers mailing list