[wp-hackers] query_posts orderby not working properly

Jake Goldman wphackers at jakemgold.myfastmail.com
Sat Aug 14 04:22:44 UTC 2010


  Valid options  for orderby and order:

http://codex.wordpress.org/Function_Reference/query_posts#Orderby_Parameters

Your first example certainly shouldn't work.  You can't order by a 
specific post's title. I'm not sure why the second example isn't working 
for you, but I can attest to the fact that it /does/ work.

What order does it give you?

Jake

On 8/13/2010 11:57 PM, Brian Fidler wrote:
> I'm having a problem getting a query to order properly. This is what I
> currently have:
> query_posts('cat='.$category->cat_ID.'&posts_per_page=-1&orderby='.
> $post->post_title . '&order=DESC');
>
> I've also tried:
> query_posts('cat='.$category->cat_ID.'&posts_per_page=-1&orderby=title&order=DESC');
>
> Any idea what I could be missing?
>
> thanks
> brian
> _______________________________________________
> 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