WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In my taxonomy.php, my query is `

  $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );  
  $wpq = array ('posts_per_page' => -1, $term->taxonomy => $term->slug, 'order' => 'ASC', 'orderby' => 'slug');
  $loop = new WP_Query($wpq);`

It correctly retrieves the droids posts I am looking for, but does not orderby slug. I can't find slug as an option in the documentation any more, but I swear I have successfully used it before.

How do I make it so?

Edit: 'orderby' => 'name' appears to work in 1 category but not in my other category (so far, there are only 2). I'm wondering if the category where it does work is just coincidence...

share|improve this question
Alternatively, what I'm actually trying to achieve is sorting by title, but ignoring "An", "A", "The" etc in the title - so "The Good Wife" should sort under "G", etc. – Amanda May 24 '11 at 12:50
up vote 0 down vote accepted

Not possible in WP 3.2.1. See here http://codex.wordpress.org/Function_Reference/get_pages under "Parameters" and "page_name".

I'm working on exactly the same thing, but it seems I'll need to resort to to a custom query: http://codex.wordpress.org/Displaying_Posts_Using_a_Custom_Select_Query

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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