0

What's wrong in this query ? the sortby=name doesn't change anything.

$the_query = 'posts_per_page=-1&sortby=name&order=ASC&post_type=mycustom&custom_cat=mycat';
// query is made               
query_posts($the_query);
  • Word of advice, never use query_posts. Use WP_Qeury or pre_get_posts instead – Pieter Goosen Apr 29 '14 at 13:53
1

The "sort" query param is usually "orderby" not "sortby", to match the SQL ORDER BY clause.

Perhaps try:

$the_query = 'posts_per_page=-1&orderby=name&order=ASC&post_type=mycustom&custom_cat=mycat';

It's also possible that the value you are passing is incorrect, but without knowing the details of your custom post type there's not much else I can suggest.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.