{"id":70909,"date":"2013-10-14T11:27:23","date_gmt":"2013-10-14T18:27:23","guid":{"rendered":"https:\/\/tri.be\/support\/forums\/topic\/custom-taxonomy-template\/"},"modified":"2013-10-14T11:31:23","modified_gmt":"2013-10-14T18:31:23","slug":"custom-taxonomy-template","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/custom-taxonomy-template\/","title":{"rendered":"Custom Taxonomy Template"},"content":{"rendered":"<p>My project requires the use of a custom taxonomy to further filter events. Let&#8217;s call this taxonomy &#8216;department&#8217;.<br \/>\nSo far I have created a template file in my theme name taxonomy-department.php pasted in the following<\/p>\n<p>EDIT: The forum failed me. It is not allowing me to post the code. Here&#8217;s a version with the php tags stripped<br \/>\ntribe_events_before_html();<br \/>\ntribe_get_view(&#8216;map&#8217;);<br \/>\ntribe_events_after_html();<\/p>\n<p>To get all the right scripts and styles enqueued I hooked into the following filters making sure they return true if `is_tax(&#8216;department&#8217;)`<br \/>\n`tribe_query_is_event_query`<br \/>\n`tribe-events-bar-should-show`<\/p>\n<p>There is still a bit more to do as the view filters don&#8217;t link to this custom taxonomy, and the pagination doesn&#8217;t work but I have an even weirder problem. This setup is not using the custom template I have set up in my theme in `tribe-events\/pro\/map.php`.<\/p>\n<p>Another thing I&#8217;ve noticed is that some of the CSS styles aren&#8217;t applied as the content is not wrapped in #tribe-events-content-wrapper, but I have yet to hunt the code for an appropriate filter to make the `tribe_events_before_template` and `tribe_events_after_template` actions fire.<\/p>\n<p>What steps are required to use a custom taxonomy with your templates and are they outline anywhere? Do you suggest any best practices for using custom taxonomies with the tribe_events post type? Would custom fields make my life easier? What would be the process there?<br \/>\nI would prefer not to use custom fields as I&#8217;d like pretty permalinks.<\/p>\n<p>Thanks for your time<\/p>\n","protected":false},"template":"","class_list":["post-70909","topic","type-topic","status-closed","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Custom Taxonomy Template -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/custom-taxonomy-template\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Custom Taxonomy Template -\" \/>\n<meta property=\"og:description\" content=\"My project requires the use of a custom taxonomy to further filter events. Let&#8217;s call this taxonomy &#8216;department&#8217;. So far I have created a template file in my theme name taxonomy-department.php pasted in the following EDIT: The forum failed me. It is not allowing me to post the code. Here&#8217;s a version with the php [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/custom-taxonomy-template\/\" \/>\n<meta property=\"article:modified_time\" content=\"2013-10-14T18:31:23+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/custom-taxonomy-template\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/custom-taxonomy-template\/\",\"name\":\"Custom Taxonomy Template -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2013-10-14T18:27:23+00:00\",\"dateModified\":\"2013-10-14T18:31:23+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/custom-taxonomy-template\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/custom-taxonomy-template\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/custom-taxonomy-template\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/theeventscalendar.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Topics\",\"item\":\"https:\/\/theeventscalendar.com\/support\/topics\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Calendar Products\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Events Calendar PRO\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Custom Taxonomy Template\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\",\"url\":\"https:\/\/theeventscalendar.com\/support\/\",\"name\":\"\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Custom Taxonomy Template -","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/custom-taxonomy-template\/","og_locale":"en_US","og_type":"article","og_title":"Custom Taxonomy Template -","og_description":"My project requires the use of a custom taxonomy to further filter events. Let&#8217;s call this taxonomy &#8216;department&#8217;. So far I have created a template file in my theme name taxonomy-department.php pasted in the following EDIT: The forum failed me. It is not allowing me to post the code. Here&#8217;s a version with the php [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/custom-taxonomy-template\/","article_modified_time":"2013-10-14T18:31:23+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/custom-taxonomy-template\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/custom-taxonomy-template\/","name":"Custom Taxonomy Template -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2013-10-14T18:27:23+00:00","dateModified":"2013-10-14T18:31:23+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/custom-taxonomy-template\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/custom-taxonomy-template\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/custom-taxonomy-template\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/theeventscalendar.com\/support\/"},{"@type":"ListItem","position":2,"name":"Topics","item":"https:\/\/theeventscalendar.com\/support\/topics\/"},{"@type":"ListItem","position":3,"name":"Calendar Products","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/"},{"@type":"ListItem","position":4,"name":"Events Calendar PRO","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/"},{"@type":"ListItem","position":5,"name":"Custom Taxonomy Template"}]},{"@type":"WebSite","@id":"https:\/\/theeventscalendar.com\/support\/#website","url":"https:\/\/theeventscalendar.com\/support\/","name":"","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/70909","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/70909\/revisions"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=70909"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}