So far this is working by filtering through and only displaying the 'sessions' 'Fall' items.
<?php
$the_query = new WP_Query( array(
'post_type' => 'classes',
'meta_key' => 'sessions'
'meta_value' => 'Fall',
'posts_per_page' => -1
));
while ($the_query->have_posts()) :
$the_query->the_post();
?>
But I want it to also filter and only display items that are in the "fall" and at "Monon Community Center"
'meta_key' => 'location_select',
'meta_value' => 'Monon Community Center',
How can I accomplish this?
I also tried this and it did not work
$the_query = new WP_Query( array(
'post_type' => 'classes',
'meta_query' => array(
'relation' => 'AND',
array(
'meta_key' => 'location_select',
'meta_value' => 'Monon Community Center',
'compare' => '='),
array(
'meta_key' => 'sessions',
'meta_value' => 'fall',
'compare' => '='),
'posts_per_page' => -1
)
));
while ($the_query->have_posts()) :
$the_query->the_post();
Under "Custom Field Parameters" on http://codex.wordpress.org/Class_Reference/WP_Query you can pass a meta_query that is an array: