Event Espresso 4 Shortcodes and Template Variables

Event Espresso 4 Shortcodes and Template Variables

This page shows shortcodes that are currently available for Event Espresso 4.

This page is a work in progress and will be updated as additional shortcodes are added to Event Espresso.

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
    [ESPRESSO_EVENTS]
  • Showed your events including expired events
    [ESPRESSO_EVENTS show_expired=true]
  • 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
    [ESPRESSO_EVENTS limit=5]
  • Filter the event list by month and year
    [ESPRESSO_EVENTS month="December 2015"]
  • Sorts the event list in ascending order
    [ESPRESSO_EVENTS sort=ASC]
  • Sorts the event list in descending order
    [ESPRESSO_EVENTS sort=DESC]
  • Order the event list by a specific set of parameters (refer to available options below)
    [ESPRESSO_EVENTS order_by=start_date,id]

These parameters (options) are available for the shortcode above. Multiple parameters should be separated by a comma.

id
start_date
end_date
event_name
venue_title
city
state

Event Ticket Selector Shortcode

  • Display a ticket selector for an event on a WordPress page or post
    [ESPRESSO_TICKET_SELECTOR event_id=your_event_id]


Event Categories Shortcode

  • Display a list of events from a specific category on a WordPress page or post
    [ESPRESSO_EVENTS category_slug=your_event_category_slug]


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
    [ESPRESSO_EVENT_ATTENDEES]

    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
    [ESPRESSO_EVENT_ATTENDEES event_id=your_event_id]

    your_event_id is a numeric ID for your event and it 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
    [ESPRESSO_EVENT_ATTENDEES datetime_id=datetime_id_for_event]

    datetime_id_for_event 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
    [ESPRESSO_EVENT_ATTENDEES ticket_id=ticket_id_for_event]

    ticket_id_for_event 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
    [ESPRESSO_EVENT_ATTENDEES show_gravatar=true]
  • List attendees with a specific registration status
    [ESPRESSO_EVENT_ATTENDEES status=status_code_here]

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.


Need more help?

Do NOT follow this link or you will be banned from the site!