Home › Forums › Backend Issues (wp-admin) › Filtering on custom field and sorting on another custom field › Reply To: Filtering on custom field and sorting on another custom field
I think you can do something like:
<?php $args = array ( 'numberposts' => -1, 'post_type' => 'member', 'post_status' => 'publish', 'meta_query' => array( 'relation' => 'AND', 'leadership_clause' => array( 'key' => 'member_category', 'value' => 'Leadership', ), 'name_clause' => array( 'key' => 'name_last_name', 'compare' => 'EXISTS', ), ), 'orderby' => array( 'leadership_clause' => 'ASC', 'name_clause' => 'ASC', ), );
Code is untested!
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
© 2022 Advanced Custom Fields.