Order by two meta keys

I have this code which works fine:

$args = array(‘post_type’ => ‘brands’,’meta_query’ => array( array( ‘key’ => ‘br_type’, ‘value’ => ‘Aviation’)),’posts_per_page’ => -1,’meta_key’ => ‘br_name’,’orderby’ => ‘meta_value’,’order’ => ‘ASC’,’fields’ => ‘ids’);

However, I need to order first by ascending order by another custom field “br_category” and then by the name br_name. I am not sure how to implement this.

Read more here:: Order by two meta keys

Leave a Reply

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