Looking to order the list of events output via a query loop in Bricks when using The Events Calendar?
Set Order by to Meta value and Order meta key to _EventStartDate
.
Result:
To display the date, you could use a Basic Text element having:
{echo:tribe_get_start_date}
3 comments
Michael van Dinther
Looking to order by upcoming or past events?
Use Meta Query within the Query Loop.
Meta Key: _EventStartDate
Meta Value:
function mizzinc_get_current_datetime() {
$current_datetime = current_time( 'mysql' );
if ( $current_datetime ) {
return $current_datetime;
} else {
return '';
}
}
Comparison: is either Greater or Lesser than or equal to.
Note the use of the custom function for the Meta Value This is important, because you want to show your users Upcoming and Past events in THEIR local time zone. Whereas current_datetime() uses UTC time zone.
Daniel Raghu
This is very timely because we're building something using The Events Calendar and I'm at my wits end.
1. Do you use the same _EventStartDate to display the date and time?
2. How do you go about styling the individual event pages? I tried this but was only able to get Bricks to pull in the main post content and not the additional fields like the map, cost, etc.
Sridhar Katakam
See if this helps: https://brickslabs.com/single-event-template-for-the-events-calendar-in-bricks/.