Skip to main content

Using Template Files

Most of what Events Manager prints on the front end comes from PHP template files in the plugin's templates folder. You can replace any one of them with your own copy, kept outside the plugin, so your changes survive plugin updates.

Reach for a template file when the change needs PHP or a different HTML structure. If you only want to change which details are shown and in what order, edit the formats in Events then Settings then Formatting with placeholders instead. If you want to add something to a template without replacing it, an action or filter is usually less work to maintain.

Before you start

You need file access to wp-content (SFTP, SSH or your host's file manager) and enough PHP to read the template you are changing.

Where Events Manager looks for a template​

Each time a template is needed, Events Manager checks these places in order and uses the first copy it finds:

OrderLocationUse it when
1wp-content/themes/your-child-theme/plugins/events-manager/The change belongs to a child theme.
2wp-content/themes/your-theme/plugins/events-manager/You build and maintain the theme yourself.
3wp-content/plugin-templates/events-manager/Every other case. Theme updates and theme switches don't touch this folder.
4wp-content/plugins/events-manager/templates/The plugin's own copy, used when no override exists.

Create the folders if they don't exist. You can move an override from one location to another at any time. Move it, don't copy it: if the same file exists in two places, the one higher in the table wins.

Override a template​

  1. Find the file in wp-content/plugins/events-manager/templates/. The folder list below says what each folder holds.

  2. Copy it to one of the override locations, keeping the path that follows the plugin's first templates folder. The plugin has a templates folder inside templates, so files from there keep one templates folder in the override path:

    wp-content/plugins/events-manager/templates/templates/events-list.php
    wp-content/plugin-templates/events-manager/templates/events-list.php

    wp-content/plugins/events-manager/templates/placeholders/bookingform.php
    wp-content/plugin-templates/events-manager/placeholders/bookingform.php

    wp-content/plugins/events-manager/templates/forms/bookingform/tickets-list.php
    wp-content/plugin-templates/events-manager/forms/bookingform/tickets-list.php
  3. Edit your copy. Keep the class, id and name attributes that are already there, because the plugin's JavaScript and CSS rely on them.

  4. Load a page that uses the template and confirm your change shows. If it doesn't, see Troubleshooting.

Copy only the files you change

Templates change between releases as features are added. An override keeps serving your old copy, so a file you copied and never edited can hide a new feature or break one. After each plugin update, compare your overrides with the new originals.

Template folders​

These are the folders inside events-manager/templates/ in version 7.5.

FolderWhat it holds
templates/Whole views: events-list.php, events-grid.php, events-list-grouped.php, events-calendar.php, calendar-day.php, event-single.php, location-single.php, locations-list.php, locations-grid.php, category-single.php, categories-list.php, tag-single.php, tags-list.php, map-global.php, my-bookings.php, events-search.php, locations-search.php, ical.php, rss.php, withdrawal-form.php, bookings-event-printable.php, and the online event pages event-location-join.php and event-location-embed.php.
templates/search/The parts of the search form: the main bar (form-main.php), the advanced search (form-advanced.php and its inline and modal variants), and one file per field, such as scope.php, categories.php, tags.php, geo.php and location-countries.php.
calendar/The calendar: calendar.php, the header and date sections, and the preview modal and tooltip.
placeholders/The output of the larger placeholders: bookingform.php, bookingbutton.php, attendees.php, attendeeslist.php, attendeespendinglist.php, categories.php, eventtags.php, eventcategoriesimages.php, locationmap.php.
forms/The front-end event and location editors (event-editor.php, location-editor.php and their parts in event/ and location/), the booking form parts in bookingform/, the ticket editor, and the time range fields in timeranges/. Some of the event/ parts are also used by the admin editor.
formats/The default text of every format in Events then Settings then Formatting, one file per setting. See Format files.
emails/The booking summary and ticket tables used in emails (bookingsummary.php, bookingtickets.php).
tables/The event and location tables on the front-end management pages.
buddypress/BuddyPress profile and group pages.

Format files​

Each file in formats/ is named after its setting with the dbem_ prefix removed, so formats/single_event_format.php supplies the Single event page format. While Advanced Mode is disabled in Events then Settings then Formatting, which is the default, every format is read from these files, and an override in your formats/ folder replaces it.

When Advanced Mode is enabled, the format groups you choose to customize are read from the settings page and the rest still come from the files. With Super Advanced Mode, all formats come from the settings and the files are ignored.

To force one format to come from its file whatever the mode, add its option name through the em_formats_filter filter:

Always load the event list item format from its file
add_filter( 'em_formats_filter', function ( $formats ) {
$formats[] = 'dbem_event_list_item_format';
return $formats;
} );

Change a template without replacing it​

Every template loaded by Events Manager fires an action before and after it, named after the template's path:

do_action( 'em_template_before_' . $template_name, $args );
// the template is included here
do_action( 'em_template_after_' . $template_name, $args );

$template_name is the path you would use for an override, including .php. This prints a notice above every event list and needs no template copy:

Add a notice above event lists
add_action( 'em_template_before_templates/events-list.php', function ( $args ) {
echo '<p class="my-events-notice">' . esc_html__( 'All times are local to the venue.', 'my-plugin' ) . '</p>';
} );

Two filters cover the remaining cases. em_locate_template_args_{template_name} changes the variables passed to a template, and em_locate_template changes which file is loaded. Both are listed in Hooks and filters.

Events Manager Pro templates​

ProRequires Events Manager Pro. Compare plans

Events Manager Pro has its own templates folder, for the checkout and cart pages, the bookings manager, PDF tickets and invoices, waitlists, RSVP and more. Overrides work the same way, in a folder named events-manager-pro that sits beside your events-manager folder, not inside it:

wp-content/plugin-templates/events-manager-pro/multiple-bookings/cart-table.php
wp-content/themes/your-theme/plugins/events-manager-pro/multiple-bookings/cart-table.php

The order of precedence differs from the free plugin. For Pro templates, a copy in wp-content/plugin-templates/events-manager-pro/ is used even if your theme has one too.

Troubleshooting​

My override is ignored

Check the path first. The most common mistake is one templates folder too many or too few. A file from the plugin's templates/templates/ folder goes in .../events-manager/templates/, and a file from templates/placeholders/ goes in .../events-manager/placeholders/.

Then check for a second copy. A file in your theme wins over one in wp-content/plugin-templates/events-manager/.

For a file in formats/, check the formatting mode. With Super Advanced Mode enabled, formats come from the settings page and format files are not read.

A feature added in an update doesn't appear

One of your overrides is probably older than the plugin's version of the same file. Rename your events-manager override folder for a moment. If the feature appears, compare each override with the current original and merge the differences.

The page shows a PHP error after an update

An overridden template may call a function or use a variable that has changed. Remove the override to confirm, then rebuild it from the current original.