What are template overrides, and how do I do them?

Published on: October 4, 2011 |Tags: | Categories: Tutorial

Please note that the list of templates here only refers to template overrides in Events 2.x. If you are looking for information on Events 3.0 and above, please head to the current Themer’s Guide.

The Events Calendar comes with a default stylesheet file and templates for different views and widgets, tailored to the Twenty Eleven theme. Template overrides provide the ability to make copies of these files and modify them in your own theme, preserving your changes the next time you update the plugin.

If you would like to alter the stylesheet or any of the templates, simply create a new folder labeled “tribe-events” in your theme directory and copy over any of the files from within the plugin’s views folder (wp-content/plugins/the-events-calendar/views/). The plugin’s stylesheet, events.css, is located in wp-content/plugins/the-events-calendar/resources/.

In addition, if you are running the PRO plugin there are additional templates in its views folder (wp-content/plugins/events-calendar-pro/views/). Following is a list of all the files (including PRO) that you can override:

  • events.css (located in the plugin’s /resources directory)
  • ecp-page-template.php
  • ecp-single-template.php
  • events-list-load-widget-display.php
  • full-address.php
  • gridview.php
  • list.php
  • single.php
  • table-mini.php
  • table.php
  • events-advanced-list-load-widget-display.php (PRO)
  • single-venue.php (PRO)
  • widget-featured-display.php (PRO)

Feel free to mix files from free & PRO in the same folder. Then, edit the new files to your heart’s content. Please do not edit any of the above files in the plugin folder(s) as you will lose any of your changes the next time you update the plugin.

Keep in mind that there may be additions or changes to the core plugin templates files or CSS that will not be migrated to the copies you have made. In this case, you will need to manually go through the files you’ve modified to determine what is different and how to implement the core changes.

Tags: |

One Response to What are template overrides, and how do I do them?

  1. Pingback: What are template overrides, and how do I do them? | Modern Tribe Inc. | Notes et pointeurs sur wordpress