EE4 Theme Templates and Tags
Wondering how to customize templates in Event Espresso 4? Well, let’s put on our developer hats and get started!
If you don’t feel like getting your hands dirty. We offer a very small set of customization options, such as removing or adding filters, moving files, creating database backups, etc., with purchase of support token(s). The support token does NOT allow for customization of the resultant templates, but it does provide a base for you to do further customizations. However, your theme must support child theming. If it does not support child theming, then the support token will cover creating the custom templates for your theme, but YOU will be responsible for ensuring they do not get overwritten on the theme updates. That being said, it might be time to start searching for a new theme or take great CARE when updating.
Each EE4 CPT has a corresponding view helper file in the /core/helpers/ folder that should get automatically loaded anytime one of our CPTs is part of the incoming request (i.e. if the current WP_Query object has one of our CPTs in the list of post_types for that request). The only two view helpers currently are:
- EEH_Event_View.helper.php
- EEH_Venue_View.helper.php
Each file contains a series of WP Template Tags (functions that can be used to add content) that can be used in the templates. You can copy your existing theme’s archive.php template and name it archive-espresso_events.php. Then you can use any of the template tags from the list below.
Here’s a list of each helper’s related template tags:
Event template tags
- espresso_event_reg_button()
(returns the “Register Now” button if event is active, an inactive button like status banner if the event is not active or a “Read More” button if so desired) - espresso_event_status_banner()
(returns a banner showing the event status if it is sold out, expired, or inactive) - espresso_event_status()
(returns the event status if it is sold out, expired, or inactive) - espresso_event_categories()
(returns the terms associated with an event) - espresso_event_tickets_available()
(returns the ticket types available for purchase for an event) - espresso_event_date_obj()
(returns the primary date object for an event) - espresso_event_date()
(returns the primary date for an event) - espresso_list_of_event_dates()
(returns a unordered list of dates for an event) - espresso_event_end_date()
(returns the last date for an event) - espresso_event_date_range()
(returns the first and last dates for an event (if different)) - espresso_event_date_as_calendar_page()
(returns the primary date for an event, stylized to appear as the page of a calendar) - espresso_event_link_url()
(the link to the event’s single page) - espresso_event_phone()
(the event’s phone #) - espresso_edit_event_link()
(returns a link to edit an event)
These tags are for displaying the Your Organization Settings info:
- espresso_organization_name()
- espresso_organization_address()
- espresso_organization_email()
- espresso_organization_logo_url()
- espresso_organization_facebook()
- espresso_organization_twitter()
- espresso_organization_linkedin()
- espresso_organization_pinterest()
- espresso_organization_google()
- espresso_organization_instagram()
EEH_Venue_View
- espresso_event_venues()
(returns all venues related to an event) - espresso_venue_name()
- espresso_venue_link()
- espresso_venue_description()
- espresso_venue_excerpt()
- espresso_venue_categories()
(returns the terms associated with a venue) - espresso_venue_address()
(returns a formatted block of html for displaying a venue’s address) - espresso_venue_has_address()
(returns TRUE or FALSE if a Venue has address information) - espresso_venue_gmap()
(returns a google map for the venue address) - espresso_venue_phone()
- espresso_venue_website()
- espresso_edit_venue_link()