Knowledgebase

Check the knowledge base articles to get a jump start on your integrations, modifications, and all around user questions. If you don’t find what you’re looking for hit the forums.

Search Knowledgebase

Embedding Calendar Views with the [tribe_events] Shortcode

Events Calendar Pro 4.3 introduced the ability to embed full calendar views in places other than the main calendar page. If you have a post or page on your site where shortcodes can be used, you can embed full calendar views there!

The shortcode that powers this functionality is [tribe_events]. In this article, we will cover the usage of this simple but powerful shortcode.


⚠️ Please Note: The [tribe_events] shortcode is only available within Events Calendar Pro. Even for core plugin views that exist in The Events Calendar, you must have Events Calendar Pro activated on your site for the [tribe_events] shortcode to work.


The Default Shortcode

Once you are running The Events Calendar 4.3 and Events Calendar Pro 4.3, you can add the shortcode [tribe_events] to any post or page on your site.

If you do not specify a view for this shortcode, then the calendar view that will display is the default calendar view from your wp-admin’s Events → Settings → Display options panel. On this settings panel, there is an option called Default view. If this is set to Month for example, then any instance of the [tribe_events] shortcode that does not specify some other view will show the Month-view calendar. If the Default view option is set to List, then any basic [tribe_events] shortcode would generate an instance of the List View, and so on.

Specifying Calendar Views

You may want to embed different views in different locations, and indeed one of the most useful things about the shortcode in the first place is the ability to do this—your main /events page could be the Month View grid calendar, but then you can embed List Views and Day Views on other pages as needed.

Specifying views is easy with the [tribe_events] shortcode—you simply use the view attribute.

So if you wanted to embed a List View calendar, you would use the shortcode [tribe_events view="list"]. Here is a full breakdown of the views that come standard with The Events Calendar and Events Calendar Pro:

  • Month View → [tribe_events view="month"]
  • List View → [tribe_events view="list"]
  • Day View → [tribe_events view="day"]
  • Photo View → [tribe_events view="photo"]
  • Week View → [tribe_events view="week"]
  • Map View → [tribe_events view="map"]

Common Shortcode Attributes for All Views

Some attributes for the [tribe_events] shortcode can be used across all event views. These are called “common” attributes. Here’s a look at each one:

category

  • This attribute filters the shortcode view to only show events that are in the specified event category.
  • Only accepts category slugs. You can find category slugs by heading to Events → Event Catgeories in your wp-admin, as shown in this screenshot.
  • Example: [tribe_events view="list" category="barbecue"]

featured

  • This attribute filters the shortcode view to only show Featured Events.
  • Only accepts “true” or “false”. Defaults to “false”.
  • Example: [tribe_events view="list" tribe-bar="false" featured=true]

date

  • By default, shortcode views render showing the “current” time—the current month in Month View, the current week in Week View, and so on.
  • This attribute makes the shortcode views load the specified date, so that can you show a specific month, week, or day.
  • Month View
    • Allowed date formats: yyyy-mm-dd or yyyy-mm
    • Month View will default to the given month if yyyy-mm-dd is used.
    • Example: [tribe_events view="month" date="2016-08"]
  • Day View
    • Allowed date formats: yyyy-mm-dd only!
    • If the yyyy-mm format is used, then the first day of the month will be loaded.
    • Example: [tribe_events view="day" date="2016-08-21"]
  • Week View
    • Allowed date formats: yyyy-mm-dd or yyyy-mm
    • The week that contains the supplied date is what will be loaded.
    • If the yyyy-mm format is used, then the week that contains the first day of the month will be loaded.
    • Example: [tribe_events view="week" date="2016-08-21"]
  • List View, Photo View, and Map View
    • Allowed date formats: yyyy-mm-dd or yyyy-mm
    • If the yyyy-mm format is used, then the first day of the month will be loaded.
    • Example: [tribe_events view="map" date="2016-08-21"]

tribe-bar

  • This attribute turns the “Tribe Bar” on or off for the generated view. The Tribe Bar contains the basic search functionality of The Events Calendar views, and the view switcher. Here’s a screenshot for reference.
  • Only accepts “true” or “false”. Defaults to “true”, which adds the Tribe Bar. “False” hides the bar.
  • Example: [tribe_events view="list" tribe-bar="false"]

Limitations of the [tribe_events] Shortcode

There are two main things to keep in mind when using the [tribe_events] shortcode.

First, there can only be one “main calendar view” per page! This means that you cannot use the [tribe_events] shortcode on the main events page, and you cannot have multiple [tribe_events] shortcodes on a single page.

Next, make sure that if you use quotation marks in your shortcodes, they are only “straight quotes” and are not “curly quotes.” If you’re not sure what this means, then the simplest way to see the difference between the quotes is to look at a screenshot like this one:

tribe_events_shortcode_error

☝️ In this screenshot, the top shortcode has a curly quote for its view attribute. This can cause numerous issues, so make sure that your shortcodes look like the bottom shortcode in the screenshot.


If you’d like to learn more about the calendar views provided by The Events Calendar and Events Calendar Pro, check out our collection of knowledgebase articles that refer to multiple calendar views here.