I'm querying a custom post type and displaying all posts by terms (basically posts by category) as follows, everything is working fine EXCEPT for some reason no matter how I write the tax_query array, I can't seem to get the order of the terms to change (ASC and DESC don't change anything).
Can anyone see where I might have gone wrong here?
$temp_query = $wp_query;
$custom_terms = get_terms('instruction_categories');
foreach($custom_terms as $custom_term) {
wp_reset_query();
$args = array(
'post_type' => 'instruction-sheets',
'orderby' => 'name', // order of the products
'order' => 'ASC',
'hide_empty' => 1,
'tax_query' => array(
array(
'taxonomy' => 'instruction_categories',
'field' => 'slug',
'terms' => $custom_term->slug,
'hide_empty' => 1,
'orderby' => $custom_term->name,
'order' => 'ASC', // switching to DESC should reverse order, but doesnt
),
),
);
$loop = new WP_Query($args);
if($loop->have_posts()) {
echo 'Region '.$custom_term->name.'';
while($loop->have_posts()) : $loop->the_post();