ORDER BY custom field value out of where clause
Define that a population has to be set, and make a list of allowed states as an array. Afterwards, take population into the orderby and sort it DESC. $q = new WP_Query( array( ‘meta_query’ => array( ‘relation’ => ‘AND’, ‘state_clause’ => array( ‘key’ => ‘state’, ‘value’ => array( ‘Wisconsin’, ‘California’ ), //allowed values ‘compare’ => … Read more