Renaming views

The Events Calendar and Events Calendar PRO ship with a number of different views, each of which has a very generic name.

Sometimes you might want to change these names – thankfully, doing so is fairly straightforward :-)

View selector

The most prominent use of view names is within the view selector, which displays within the Tribe Events Bar. To change the names that appear here you need only add a small piece of code to your theme's functions.php file (or some other suitable place) mapping out what you want to use instead.

Such a snippet would look something like this:

In this example, we are changing "List" to "All Events", "Month" to "Calendar" and "Photo" to "Picture Board" as described in lines 7-11: feel free to alter that section to meet your own specific requirements.

View slugs

The above works nicely and will be sufficient for many users, however something that is left unaddressed is the URL of those views.

For example, month view will still be found at example.com/events/month rather than example.com/events/calendar ... if that is a problem it is certainly possible to address it, but involves more complicated customization.

We'll continue by building on the same example as above, on the basis that:

  • Instead of /events/list/ we want to use /events/all-events/
  • Instead of /events/month/ we want to use /events/calendar/
  • Instead of /events/photo/ we want to use /events/picture-board/

To do this we need to change some of the rewrite rules registered by The Events Calendar registers. To do so, try adding this additional snippet:

https://gist.github.com/theeventscalendar/649342aa266abe9a9234

For these to take effect you will have to visit the Settings → Permalinks screen (you don't normally have to change anything, though, as just visiting this admin screen will "flush" the rewrite rules).

However, the problem is that although you should now be able to navigate to example.com/events/calendar and see month view, The Events Calendar itself will continue to form links that point to our old URL. To remedy this — and to catch the same problem in respect of list view— we need one more filter:

With all three components in place and so long as the rewrite rules have been flushed you should now find that:

  • List view is called "All Events" and is accessible at example.com/events/all-events/
  • Month view is called "Calendar" and is accessible at example.com/events/calendar/
  • Photo view is called "Picture Board" and is accessible at example.com/events/picture-board

We hope this is helpful, but would offer up a word of caution: playing with rewrite rules, particularly on sites with a complex stack of plugins in place, can be a tricky business - so it is always best to test this out in a staging or development environment first of all.

If you feel at all unsure, stick to the first part of the tutorial and change the names only within the view selector itself.

Good luck 😀