Hi there,
I want to get a list of events for a special category (“highlights”). Right now, I use following code:
<?php
$args = array(
'post_type' => 'tribe_events',
'posts_per_page' => 2,
'tax_query' => array(
array(
'taxonomy' => 'tribe_events_cat',
'field' => 'slug',
'terms' => 'highlight',
),
),
);
$query = new WP_Query( $args );
$myposts = get_posts( $args );
foreach ( $myposts as $post ) : setup_postdata( $post ); ?>
<h2><?php echo tribe_get_start_date( null, false, 'D | d. F' ); ?></h2>
<p><?php echo the_title();?></p>
<?php endforeach; wp_reset_postdata();?>
In this case, I get a list of all events for the category “highlights”. But there are also included older events in the past. How to filter the list of events only for all upcoming events a(including events of the same day) ?
Thank you!