Event Espresso 4 Shortcodes and Template Variables
This page shows shortcodes that are currently available for Event Espresso 4.
A similar list of shortcodes can also be found in the Help & Support tab for Event Espresso. To reach this tab, login to your WordPress admin (WP Dashboard) and locate Event Espresso in the WordPress admin menu. Then click on Help & Support. You’ll see available options in the Shortcodes tab.
Event Listings Shortcode
Displays a list of events based on a set of criteria on a WordPress page or post. Unless otherwise specified, events are sorted by start date.
- Show a list of all of your events
- Showed your events including expired events
- Set a custom title for the event list
[ESPRESSO_EVENTS title="My Super Event List"]
- Limit (paginate) the number of events that are shown in the event list on a page or post
- Filter the event list by month and year
[ESPRESSO_EVENTS month="December 2019"]
- Remove the title heading
- Sorts the event list in ascending order
- Sorts the event list in descending order
- Order the event list by a specific set of parameters (refer to available options below)
The following sorting parameters (or options) are available to work with the
order_by parameter listed above. Multiple parameters can be separated by a comma.
Event Ticket Selector Shortcode
- Display a ticket selector for an event on a WordPress page or post
Event Categories Shortcode
- Display a list of events from a specific category on a WordPress page or post
- Display a list of events from two or more categories (separated by a comma) on a WordPress page or post
Event Attendees Shortcode
This shortcode represents the link between attendees and a specific event.
- List approved attendees for the earliest active event or the earliest upcoming event
With no parameters set, this shows the attendees for the earliest active event or if there is no active event, then the earliest upcoming event is shown. If it is used in the event description area (via your event editor), then it will show the attendees for that specific event.
- List the attendees for a specific event
Replace `123` with numeric ID for your event. The ID can be found by looking at the ID column in the Events Overview screen in your WP Dashboard.
- List the attendees for a specific datetime
The datetime_id is a numeric ID for your datetime and it can be found by looking at the ID which appears for a datetime when you have clicked the advanced options (gear icon) for a specific datetime in the datetimes editor within the event editor in your WP Dashboard.
- List the attendees for a specific ticket
The ticket_id is a numeric ID for your ticket and it can be found by looking at the ID which appears for a ticket when you have clicked the advanced options (gear icon) for a specific ticket in the ticket editor within the event editor in your WP Dashboard.
- List attendees with Gravatars
- List attendees with a specific registration status
These parameters (status options) are available for the shortcode above. Use “all” to return all attendees regardless of status. If this parameter is not set, then the shortcode will return attendees/registrants with a status of approved.
status=RAP (shows attendees with a registration status of approved. This is the default behavior.)
status=RCN (shows attendees with a registration status of cancelled.)
status=RDC (shows attendees with a registration status of declined.)
status=RIC (shows attendees with a registration status of incomplete.)
status=RNA (shows attendees with a registration status of not approved.)
status=RPP (shows attendees with a registration status of pending payment.)
How to customize the Attendee list templates
Step 1: Copy the espresso_event_attendees.php template from the /event-espresso-core-reg/public/Espresso_Arabica_2014/ folder to your WordPress child theme’s folder.
The main template’s name is content-espresso_event_attendees.php. If you need to modify the loop, you can copy loop-espresso_event_attendees.php.
Step 2: Make your modifications to the templates that you copied to your theme.
Examples of customized Attendee list templates
Example of how to add an answer value from a registration form question to the attendee list
After you follow steps 1 and 2 above, you can add some PHP code to your templates to get and display the answer of a custom registration form question. There is an example template that you can modify/reuse/adapt located in this Github gist.
Example of how to add a ticket quantity for each contact in the attendee list
After you follow steps 1 and 2 above, you can add some PHP code to your templates to get and display the number of tickets related to the contact for the event. There is an example template that you can modify/reuse/adapt located in this Github gist. This example adds a digit after the attendee name if the quantity of tickets is greater than one. This is useful only if additional attendee names are not captured from the registration form.
Migrating EE3 shortcodes to EE4
If you are migrating to EE4 from EE3, there are a few shortcodes that can be converted from EE3 to EE4.
- The EE3 [EVENT_LIST] shortcode’s equivalent is [ESPRESSO_EVENTS]
- The EE3 [ESPRESSO_REG_FORM] is roughly equivalent to [ESPRESSO_TICKET_SELECTOR]
- [EVENT_ESPRESSO_CATEGORY event_category_id=your_category_identifier] can be replaced with [ESPRESSO_EVENTS category_slug=your_category_identifier]
Reminder: this page is a work in progress and will be updated as additional shortcodes are added to Event Espresso.