3rd Oct '23
/
5 comments

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 610 Bricks code tutorials with BricksLabs Pro

5 comments

  • Ronnie Fang

    This is very helpful!

    I'm trying to create a custom events archive page that lists all events by the selected month. I'm stuck using the TEC backend but do not like the use of AJAX on their frontend.

    The user would be able to navigate back in time one page (month) at a time. I was wondering if you could provide some tips or a starting point on how to implement this query filter as well as the pagination navigation by month.

  • 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
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
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 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
Non-empty events sorted by event date and other posts below in Bricks

Non-empty events sorted by event date and other posts below in Bricks

Updated on 15 Jan 2024 Consider a scenario where you are showing posts from multiple post types namely post, event and game in a single…
Categories:
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 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:
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: