Ordering The Events Calendar Events in Bricks

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}

Get access to all 525 Bricks code tutorials with BricksLabs Pro

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.

Leave your comment

 

Related Tutorials..

Pro
Custom SQL Ordering for Sorting Events in Bricks

Custom SQL Ordering for Sorting Events in Bricks

Showing events ordered by the event date with upcoming events in ascending order and past events in descending order.
Categories:
Pro
Events grouped by Event Date custom field in Bricks

Events grouped by Event Date custom field in Bricks

This Pro tutorial for Bricks users provides the steps to output posts of an event custom post type dynamically grouped by the value of their…
Categories:
Pro
Upcoming Events Grouped by ‘Month Year’ in Bricks

Upcoming Events Grouped by ‘Month Year’ in Bricks

A custom query loop type for showing future events based on a date custom field using three nested query loops.
How to Show Future Events in Bricks

How to Show Future Events in Bricks

One of the common requirements in WordPress is being able to filter the events (or could be posts of any post type) to only those…
Categories:
Pro
Modern Events Calendar in Bricks

Modern Events Calendar in Bricks

This Pro tutorial provides the steps for using Modern Events Calendar in Bricks. We shall set up the single event Bricks template with a combination…
Pro
Events grouped by months within years based on event date custom field value

Events grouped by months within years based on event date custom field value

How to output events grouped by years and months using three nested query loops in Bricks.
Categories:
Pro
ACF Relationship: Show all other events related to the artists of the current event

ACF Relationship: Show all other events related to the artists of the current event

How all other events related to the artists of the current event can be output in a Bricks query loop.
Categories:
Pro
Single Event Template for The Events Calendar in Bricks

Single Event Template for The Events Calendar in Bricks

Updated on 19 Sep 2024 The Events Calendar is one of the most popular event plugins for WordPress. With The Events Calendar active, single event…
Pro
Events Grouped by Event Year

Events Grouped by Event Year

In this Pro tutorial, we share the PHP code for outputting past events grouped by the event year in descending order of the event year.…
Categories:
Tags: