I am getting the posts by a custom taxonomy called "wall_of_fame". This gets me all the posts that match "Yes" in this custom taxonomy.

$query_args = array(

    'post_type' => 'artists',
    'posts_per_page' => 30,
    'tax_query' => array(
            'taxonomy' => 'wall_of_fame',
            'field' => 'Yes',
            'terms' => 23,


I have another custom taxonomy called "year_of_participation" which has years from 1997 until 2021. Is there a way to query posts by custom taxonomy "wall_of_fame" but sort them by custom taxonomy "year_of_participation"

How and where in my $query_args can I add the orderby second taxonomy?

Thank you so much!

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.