Support

Home Forums Event Espresso Premium Retrieve first datetime from events?

Retrieve first datetime from events?

Posted: January 6, 2016 at 10:18 am


KineticPulse

January 6, 2016 at 10:18 am

I’ve used a custom loop to create a summary list of upcoming events, but I only want to show the next datetime for each one (rather than all the dates). How can I do this?

Here is my code:

<?php			
	$atts = array(
	'title' => NULL,
	'limit' => 5,
	'css_class' => NULL,
	'show_expired' => FALSE,
	'month' => NULL,
	'category_slug' => NULL,
	'order_by' => 'start_date',
        'sort' => 'ASC'
	);
// run the query
global $wp_query;
$wp_query = new EE_Event_List_Query( $atts );
?>

<?php while(have_posts()): the_post(); ?>
<?php espresso_get_template_part( 'content', 'espresso_events-header' ); ?>
<?php espresso_get_template_part( 'content', 'espresso_events-datetimes' ); ?>
						
<?php endwhile;?>


KineticPulse

January 6, 2016 at 10:37 am

Aha – figured it out just after I posted!

`<?php espresso_list_of_event_dates( $post->ID,”,”,true,null,true,true,1 );?>

The support post ‘Retrieve first datetime from events?’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso