jondcampbell
8/21/2014 - 5:52 PM

Query event espresso 4 events and order by the events start date. Using this instead of a wp query of espresso_events post type.

Query event espresso 4 events and order by the events start date. Using this instead of a wp query of espresso_events post type.

<ul class="events">
<?php			
$events_args = array(
	'title' => NULL,
	'limit' => 100,
	'css_class' => NULL,
	'show_expired' => FALSE,
	'month' => NULL,
	'category_slug' => NULL,
	'order_by' => 'start_date',
	'sort' => 'ASC'
);
// run the query
$events = new EE_Event_List_Query( $events_args );
	if ($events->have_posts()) : while ($events->have_posts()) : $events->the_post();
        ?>
        <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>    	
<?php
	endwhile;
	else:
?>
	<li>No Upcoming Events</li>
<?php 
    endif;
// now reset the query and postdata
wp_reset_query();
wp_reset_postdata();
?>
    </ul>