0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | function jma_add_custom_taxonomy_query( $query ) { if( $query->is_admin || !$query->is_main_query() || true == $query->query_vars['suppress_filters'] ) return; //order cats by title (use 'name' for slug) if( $query->is_category(array(148,160,161)) ) { $query->set('orderby', 'title'); $query->set('order', 'ASC'); } } add_action( 'pre_get_posts', 'jma_add_custom_taxonomy_query' ); |