Home › Forums › General Issues › Multi Select – Get all choices for Query Args › Reply To: Multi Select – Get all choices for Query Args
Hmm
<?php
// Variables
$number_of_events = get_field( 'number_of_events' );
// print_r($number_of_events);
$event_categories = get_field('event_categories');
$event_cat_ids = wp_list_pluck( $event_categories, 'term_id' );
#$event_cat_ids = array( 1, 31 );
$args = array(
'post_type' => 'event',
'post_status' => 'publish',
'posts_per_page' => $number_of_events,
'order' => 'DESC',
);
$args['tax_query'] = array(
'relation' => 'OR',
array(
'taxonomy' => 'event_category',
'field' => 'term_id',
'terms' => $event_cat_ids
),
);
$query = new WP_Query( $args );
if( $query->have_posts() ) :
while( $query->have_posts() ): $query->the_post(); ?>
<?php the_title(); ?>
<?php endwhile; wp_reset_postdata();
endif;
?>?>
does work now. Virtual 3 shows me
Event 4 Virtual Event 3 Virtual Event One Virtual
Only display of block on page in editor is hidden all the time on save. Perhaps related to
Uncaught TypeError: Cannot read properties of null (reading 'addEventListener') at toggle.js?ver=5.8.1:7
Not sure yet.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.