I have a Wordpress installation with ACF (Advanced Custom Fields) installed. I created the Class post type and each Class has it's on Location value.
How can I retrieve every Class and get the location I have chosen for that Class?
I'm currently using this function to retrieve the name of the 'Programs':
<pre>
$args = array(
'post_type' => 'class',
'posts_per_page' => -1,
);
$query = new WP_Query($args);
if ($query->have_posts() ) :
while ( $query->have_posts() ) : $query->the_post();
echo get_the_ID();
echo get_the_title();
endwhile;
endif;
</pre>
I'm trying to populate a dropdown list 'Location' which filters the next dropdown with the classes available for that location.
Any help or advice would be greatly appreciated. Thanks