4.3 How to Customize Template Files

Created by Danny Wong, Modified on Sun, 09 Aug 2020 at 12:45 PM by Danny Wong

? This article covers Views 2 (V2), the updated design of calendar views that shipped in The Events Calendar 5 and Events Calendar Pro 5. If you are using the legacy views, please check out the guide to customizing template files for Views 1.

The Events Calendar comes with a number of template files that determine how the plugin looks and behaves. We call these views. You can customize these files by placing copies of them in your theme.

It’s important that you don’t edit the view files directly in the plugin. Instead, we recommend overriding the files in your theme, which is what we are going to cover in this guide. This ensures that any changes you make to the files will not be lost when new versions of the plugins are released. In fact, we strongly recommend keeping your custom calendar view templates in a child theme, especially if you use a third-party theme that releases new versions. This plugin can be helpful for creating child themes. The Events Calendar will ensure that your modified files, in the correct folder, will override the plugin files.

OK, now that we’ve established some housekeeping rules, let’s dig into the process of customizing template files by overriding them in your theme.

Locating template files

Every plugin is located on your server where WordPress is installed in the /wp-content/plugins folder. Here’s where you can find the template files for each plugin.

Plugin
Template Files
The Events Calendar
/the-events-calendar/src/views/v2/
Events Calendar Pro
/events-pro/src/views/v2/

First, add a new folder in your theme

Once you’ve located the template file you want to customize, make a copy of it and save it somewhere for a moment, like your computer desktop.

Next, let’s head over to your theme folder and create a new folder.  Not sure where your theme folder is located? It’s where WordPress is installed in the /wp-content/themes folder. So if you are using the official Twenty Twenty theme, it would be at /wp-content/themes/twentytwenty. Once you find it, create a new folder called tribe.

So far, you should have a new folder in your theme located at: /wp-content/themes/your-theme/tribe/

Now, which plugin or add-on does your copied template file belong to? You’ll need to make another folder that correlates with the plugin you are customizing. That includes the following:

Plugin
Folder
The Events Calendar (legacy views)
/tribe/events/
The Events Calendar (new views)
/tribe/events/v2
Events Calendar Pro
/tribe/events-pro/v2

With the new views, your folder structure should look like this:

Folder structure for overriding the new views templates.

Customize the template

Now that you’ve located the template you want to override, made a copy of it, created a new tribe/ folder in your theme, and put the copied template file in its corresponding plugin folder, you can start customizing!

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article