0

I have a custom post type called Team. This consists of people. Each person is linked to a taxonomy called Team. I want a WP_Query which displays the results by the taxonomy menu order and then alphabetically on the persons name within each taxonomy. A sample case is given below:

Teams

  • Team Gold
  • Team Blue
  • Team Red

People

  • John - (Team Red)
  • James - (Team Blue)
  • Jodie - (Team Gold)
  • Paul - (Team Red)

Desired Output

  • Jodie
  • James
  • Paul
  • John

I've only managed to group by team but not based on menu order.

My WP_Query looks as follows:

$wp_query   =   new WP_Query( array(
                        'meta_key'          =>  'team_category',
                        'orderby'           =>  array('meta_value' => 'ASC', 'title' => 'ASC'),
                        'order'             =>  'ASC',
                        'post_type'         =>  'team',
                        'posts_per_page'    =>  -1,
                        'paged'             =>  $paged ) );
  • How are you implementing ordering of taxonomy terms. Taxonomy terms cannot be manually ordered out of the box in WordPress. – Jacob Peattie Nov 8 at 12:21

Your Answer

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

Browse other questions tagged or ask your own question.