Support

Account

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.