[wp-hackers] Multiple orderby and order options in WP_Query

Eric Mann eric at eam.me
Tue Apr 5 14:16:52 UTC 2011


A raw SQL query would do this for you ... "ORDER BY author ASC, date DESC"
but I'm not sure if WP_Query supports that.  That's why I suggested ordering
in PHP over just passing a straight query.

Can anyone confirm whether or not WP_Query can handle multiple column
ordering like this?

On Tue, Apr 5, 2011 at 7:07 AM, <patrik.bona at mrhead.sk> wrote:

> MySql support this so there is no need to do it in PHP.
>
> Patrik
>
> > MySQL does support ordering by multiple columns, but not in the sense of
> > ordering one ASC and the other DESC.  So separate your two paradigms, let
> > MySQL take care of one for you, then manually do the other via PHP.
> >
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list