Advanced Custom Fields Query with Different Values of the Same Key
One option is to fetch all of the posts to a single array and filter that array 50 ways. This would only generate the one query: $posts = get_posts(array( ‘posts_per_page’ => -1, ‘post_type’ => ‘school’ )); To filter your array you would do something like this: $this_state = “Texas”; $state_posts = array_filter($posts, function($results) use($this_state) { … Read more