I’m using this code snippet from your site to show upcoming events after the venue details are output on a venue page but can’t work out how to add a simple order by parameter to this query to get it to show them ordered by start date ASC.
I’ve tried adding ‘order_by’ => ‘Datetime.DTT_EVT_start’, but that threw fatal errors.
Any tips or guidance would be much appreciated thanks ๐
function ee_list_upcoming_events_for_a_venue( $post ) {
// query the events for this venue using EE_Venue's events() method
// http://code.eventespresso.com/classes/EE_Venue.html#method_events
$query_params = array(
array(
'status' => 'publish',
'Datetime.DTT_EVT_start' => array(
'>',
date( current_time( 'mysql', true ) ),
'Datetime.DTT_EVT_end' => array(
'<',
date( current_time( 'mysql', true ) )
)
)
)
);
The support post ‘Add order by to these Query Params’ 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.
Support forum for Event Espresso 3 and Event Espresso 4.