Querying, storing, and using data from 2 separate custom post types
For custom field queries you can’t use an array for multiple keys, unfortunately. What you want is something like this: $args = array( ‘post_type’ => array(‘gym_location’, ‘gym_term’), ‘orderby’ => ‘title’, ‘order’ => ‘DESC’, ‘meta_query’ => array( array( ‘key’ => ‘term_active’, ‘value’ => ‘1’, ‘compare’ => ‘==’ ), array( ‘key’ => ‘location_active’, ‘value’ => ‘1’, ‘compare’ … Read more