Order by +/- ?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Order by +/- ?

Danny Ayers
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.

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

Cheers,
Danny.

--

http://dannyayers.com
_______________________________________________
wp-hackers mailing list
[hidden email]
http://lists.automattic.com/mailman/listinfo/wp-hackers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Order by +/- ?

Andy Skelton
On 2/2/06, Danny Ayers <[hidden email]> 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.

Cheers,
Andy
_______________________________________________
wp-hackers mailing list
[hidden email]
http://lists.automattic.com/mailman/listinfo/wp-hackers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Order by +/- ?

Sam Angove
> > 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.

That, or pass `order=ASC`/`order=DESC`...
_______________________________________________
wp-hackers mailing list
[hidden email]
http://lists.automattic.com/mailman/listinfo/wp-hackers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Order by +/- ?

Stewart Ugelow
> > > 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.
>
> That, or pass `order=ASC`/`order=DESC`...

Although passing the order is problematic if you're not using the
mod_rewrite rules.

http://trac.wordpress.org/ticket/2333

--Stewart

--

Stewart Ugelow
www.ugelow.com
_______________________________________________
wp-hackers mailing list
[hidden email]
http://lists.automattic.com/mailman/listinfo/wp-hackers
Loading...