{"id":1945606,"date":"2020-02-07T13:02:05","date_gmt":"2020-02-07T18:02:05","guid":{"rendered":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/?post_type=tribe-knowledgebase&#038;p=1945606"},"modified":"2025-04-03T10:20:30","modified_gmt":"2025-04-03T14:20:30","slug":"custom-templates-for-the-updated-calendar-views","status":"publish","type":"post","link":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/custom-templates-for-the-updated-calendar-views\/","title":{"rendered":"Custom Templates for Calendar Views"},"content":{"rendered":"\n<p>The calendar views that are available with The Events Calendar can be customized by overriding the templates and creating a copy of the template in your theme..<\/p>\n\n\n\n<p>There are a couple of things that are important to note about the calendar views templates, as they are using a new engine that relies heavily on which the plugin originally created the template instance. So when you are talking about calendar views, you are looking at Event-related namespacing for your theme files.<\/p>\n\n\n\n<p>Examples from Plugin to Theme loading path:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>the-events-calendar\/src\/views\/v2\/list\/event.php<\/code> <strong>\u27a1\ufe0f<\/strong> <code>\/tribe\/events\/v2\/list\/event.php<\/code><\/li>\n\n\n\n<li><code>events-calendar-pro\/src\/views\/v2\/photo\/event.php<\/code> \u27a1\ufe0f <code>\/tribe\/event-pro\/v2\/photo\/event.php<\/code><\/li>\n<\/ul>\n\n\n\n<p>We included a way for third-party developers to add their own custom folders to our plugins, but once those add-ons kick in, they will change which namespace we will load.<\/p>\n\n\n\n<p>Example:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Original file:<br><code>events-calendar-pro\/src\/views\/v2\/photo\/event.php<\/code> \u27a1\ufe0f <code>\/tribe\/event-pro\/v2\/photo\/event.php<\/code><\/li>\n\n\n\n<li>Overwritten by custom plugin path:<br><code>my-plugin\/custom\/v2\/photo\/event.php<\/code> \u27a1\ufe0f <code>\/tribe\/my-plugin\/v2\/photo\/event.php<\/code> <\/li>\n<\/ul>\n\n\n\n<p>If you are looking for simple one-to-one customization of a given template you should not be using this code, you should instead look at a couple of other documentation articles we have on our website:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/staging.theeventscalendar.com\/knowledgebase\/k\/using-template-filters-and-actions\/\" target=\"_blank\" rel=\"noreferrer noopener\">How to use template Filters and Actions<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/staging.theeventscalendar.com\/knowledgebase\/k\/how-to-customize-templates-and-css-in-a-view\/\" target=\"_blank\" rel=\"noreferrer noopener\">How to customize the Photo view<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/staging.theeventscalendar.com\/knowledgebase\/k\/display-custom-fields-in-the-month-view-tooltip\/\" target=\"_blank\" rel=\"noreferrer noopener\">Display Custom Fields in the Month View Tooltip<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/staging.theeventscalendar.com\/knowledgebase\/k\/show-events-by-custom-field\/\" target=\"_blank\" rel=\"noreferrer noopener\">How to increase functionality based on custom fields (Advanced)<\/a><\/li>\n<\/ul>\n\n\n\n<p>The code below is the simplest example of adding custom plugin paths to The Events Calendar. Important to note that if you don&#8217;t want to overwrite the namespace from Event, you can comment out that argument\/index on your folder addition.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\n&lt;?php\n\/**\n * Add your own plugin as a template override location for The Events Calendar, Event Tickets, and related plugins.\n * This only applies to templates using the new Template Engine, as of version 5.0.1 that include Updated Views and Blocks.\n *\n * Each custom array&#039;s `path` is whatever you want it to be (i.e. customizable) up until the &#039;v2&#039; part of each\n * template&#039;s override path.\n *\n * So if the The Events Calendar location for a view is:\n *     \/wp-content\/plugins\/the-events-calendar\/src\/views\/v2\/list\/event\/featured-image.php\n *\n * Then this plugin&#039;s override location would be:\n *     \/wp-content\/plugins\/MY-PLUGIN\/tribe-customizations\/v2\/list\/event\/featured-image.php\n *\n * And the theme&#039;s override location would be:\n *     \/wp-content\/themes\/YOUR-CHILD-THEME\/tribe\/my-plugin\/v2\/list\/event\/featured-image.php\n *\n * FYI: Parent\/Child Themes will override this custom plugin&#039;s override. Use your own custom code with the\n *      `tribe_template_theme_path_list` filter instead of this snippet to trump theme overrides if you must, but that is not\n *      typical best practice, although it may be necessary in order to override a theme that comes with V2 Views overrides\n *      (e.g. Avada) that you want to override.\n *\n * @link https:\/\/staging.theeventscalendar.com\/knowledgebase\/k\/custom-additional-template-locations\/\n *\n * @see  \\Tribe__Template::get_template_path_list()\n * @see  \\Tribe__Template::get_template_folder()\n *\n * @param array            $folders  Array of data for loading locations.\n * @param \\Tribe__Template $template Instance of the template engine we are working with.\n *\n * @return array\n *\/\nfunction tribe_v2_additional_plugin_template_locations( $folders, \\Tribe__Template $template ) {\n\t\/\/ Which file namespace your plugin will use.\n\t$plugin_name = &#039;my-plugin&#039;;\n\n\t\/\/ Which order we should load your plugin files at.\n\t$priority = 5;\n\t\/\/ Plugin in which the file was loaded from = 20\n\t\/\/ Events Pro = 25\n\t\/\/ Tickets = 17\n\n\t\/\/ Which folder in your plugin the customizations will be loaded from.\n\t$custom_folder&#x5B;] = &#039;tribe-customizations&#039;;\n\n\t\/\/ Builds the correct file path to look for.\n\t$plugin_path = array_merge(\n\t\t(array) trailingslashit( plugin_dir_path( __FILE__ ) ),\n\t\t(array) $custom_folder,\n\t\tarray_diff( $template-&gt;get_template_folder(), &#x5B; &#039;src&#039;, &#039;views&#039; ] )\n\t);\n\n\t\/**\n\t * Examples:\n\t *\n\t * src\/views\/v2\/list.php -&gt; my-plugin\/tribe-customizations\/v2\/list.php\n\t * src\/views\/v2\/list\/event\/cost.php -&gt; my-plugin\/tribe-customizations\/v2\/list\/event\/cost.php\n\t * src\/views\/v2\/photo\/event\/cost.php -&gt; my-plugin\/tribe-customizations\/v2\/photo\/event\/cost.php\n\t * src\/views\/v2\/organizer\/meta\/details\/phone.php -&gt; my-plugin\/tribe-customizations\/v2\/organizer\/meta\/details\/phone.php\n\t *\/\n\n\t\/*\n\t * Custom loading location for overwriting file loading.\n\t *\/\n\t$folders&#x5B; $plugin_name ] = &#x5B;\n\t\t&#039;id&#039;        =&gt; $plugin_name,\n\t\t&#039;namespace&#039; =&gt; $plugin_name, \/\/ Only set this if you want to overwrite theme namespacing\n\t\t&#039;priority&#039;  =&gt; $priority,\n\t\t&#039;path&#039;      =&gt; $plugin_path,\n\t];\n\n\treturn $folders;\n}\n\nadd_filter( &#039;tribe_template_path_list&#039;, &#039;tribe_v2_additional_plugin_template_locations&#039;, 10, 2 );\n<\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>The calendar views that are available with The Events Calendar can be customized by overriding the templates and creating a copy of the template in your theme.. There are a couple of things that are important to note about the calendar views templates, as they are using a new engine that relies heavily on which&#8230;<\/p>\n","protected":false},"author":3,"featured_media":1955565,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","_swpsp_post_exclude":false,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"ep_exclude_from_search":false,"footnotes":""},"categories":[79,84],"tags":[25,83],"stellar-product-taxonomy":[158,161],"class_list":["post-1945606","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-snippets","category-theming-overview","tag-customizations","tag-templates","stellar-product-taxonomy-events-calendar-pro","stellar-product-taxonomy-the-events-calendar"],"acf":[],"taxonomy_info":{"category":[{"value":79,"label":"Snippets"},{"value":84,"label":"Templating &amp; Layout"}],"post_tag":[{"value":25,"label":"Customizations"},{"value":83,"label":"Templates"}],"stellar-product-taxonomy":[{"value":158,"label":"Events Calendar Pro"},{"value":161,"label":"The Events Calendar"}]},"featured_image_src_large":["https:\/\/images.theeventscalendar.com\/kb\/uploads\/2023\/02\/social-share-1024x538.png",1024,538,true],"author_info":{"display_name":"Jaime Marchwinski","author_link":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/author\/jaimetri-be\/"},"comment_info":0,"category_info":[{"term_id":79,"name":"Snippets","slug":"snippets","term_group":0,"term_taxonomy_id":79,"taxonomy":"category","description":"","parent":0,"count":136,"filter":"raw","term_order":"0","cat_ID":79,"category_count":136,"category_description":"","cat_name":"Snippets","category_nicename":"snippets","category_parent":0},{"term_id":84,"name":"Templating &amp; Layout","slug":"theming-overview","term_group":0,"term_taxonomy_id":84,"taxonomy":"category","description":"","parent":24,"count":59,"filter":"raw","term_order":"0","cat_ID":84,"category_count":59,"category_description":"","cat_name":"Templating &amp; Layout","category_nicename":"theming-overview","category_parent":24}],"tag_info":[{"term_id":25,"name":"Customizations","slug":"customizations","term_group":0,"term_taxonomy_id":25,"taxonomy":"post_tag","description":"","parent":0,"count":177,"filter":"raw","term_order":"0"},{"term_id":83,"name":"Templates","slug":"templates","term_group":0,"term_taxonomy_id":83,"taxonomy":"post_tag","description":"","parent":0,"count":6,"filter":"raw","term_order":"0"}],"_links":{"self":[{"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1945606","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/comments?post=1945606"}],"version-history":[{"count":2,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1945606\/revisions"}],"predecessor-version":[{"id":1964599,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1945606\/revisions\/1964599"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/media\/1955565"}],"wp:attachment":[{"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/media?parent=1945606"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/categories?post=1945606"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/tags?post=1945606"},{"taxonomy":"stellar-product-taxonomy","embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/stellar-product-taxonomy?post=1945606"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}