The Events Calendar by StellarWP, formerly by Modern Tribe, is a powerful plugin for managing events on a WordPress site. However, when it comes to displaying past events in descending order, you may encounter limitations or need to create custom code to display events how you’d like. In this tutorial, we’ll explore how to achieve this using The Events Calendar Shortcode & Block Pro with no coding required!
Step 1: Install The Events Calendar Shortcode & Block
If you haven’t installed The Events Calendar Shortcode & Block Pro plugin yet, you can find and install it from the zip file provided after purchase. Once activated, you’ll have additional shortcode options for displaying events.
Once installed, if you don’t already have The Events Calendar installed, you’ll be prompted to do so.
Step 2: Use [ecs-list-events]
Shortcode
The [ecs-list-events]
shortcode is provided by The Events Calendar Shortcode & Block Pro plugin and allows you to customize the display of events. To show past events in descending order, you can use the past
and order
attributes.
[ecs-list-events past='yes' order='DESC']
- The
past='yes'
attribute ensures that only past events are displayed. - The
order='DESC'
attribute specifies that events should be listed in descending order, with the latest events first.
If you’re using the block provided by the plugin instead, you can set the Order to Descending. Then, in the “Choose Another Option” dropdown at the bottom, pick Past Events to enable the setting:
Step 3: Add Additional Attributes (Optional)
The [ecs-list-events]
shortcode provides various attributes to customize the event display. You can add more attributes to tailor the output according to your needs. For example:
[ecs-list-events past='yes' order='DESC' limit='10' venue='true' excerpt='true']
limit='10'
: Limits the number of events displayed to 10.venue='true'
: Includes venue information in the event list.excerpt='true'
: Displays event excerpts.
Feel free to experiment with different attributes to achieve the desired look and feel for your past events listing.
Step 4: Insert Shortcode in a Post or Page
Once you have configured the [ecs-list-events]
shortcode with the desired attributes, insert it into the content of a post or page where you want the past events to be displayed. Save or update the post/page.
Conclusion
By using The Events Calendar Shortcode & Block plugin and the [ecs-list-events]
shortcode with the appropriate attributes, you can easily display past events from The Events Calendar Pro in descending order on your WordPress site. This provides a flexible and efficient way to showcase your event history to your audience.