WP_Query Order by meta_key menu_order?

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. Example:

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

My WP Query looks as follows… I’ve only managed to group by team, but not based on menu order:

$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 ) );

Read more here:: WP_Query Order by meta_key menu_order?

Leave a Reply

Your email address will not be published. Required fields are marked *