{"id":30616,"date":"2013-01-10T21:19:52","date_gmt":"2013-01-11T05:19:52","guid":{"rendered":"http:\/\/tri.be\/support\/forums\/topic\/making-the-mini-calendar-show-specific-categories\/"},"modified":"2015-07-07T06:26:36","modified_gmt":"2015-07-07T13:26:36","slug":"making-the-mini-calendar-show-specific-categories","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/making-the-mini-calendar-show-specific-categories\/","title":{"rendered":"Making the mini-calendar show specific categories"},"content":{"rendered":"<p>I recently installed the PRO version of The Events Calendar and was surprised to see this wasn&#8217;t a feature! The ability to have the mini calendar display a specific category of events. After researching it on the web and in these forums, I couldn&#8217;t find anything for it. I&#8217;m not sure if this has been posted yet, but for anyone looking to do this, here&#8217;s how to do it.<\/p>\n<p>Step 1. Allow arguments to be passed through the mini-grid function. Open up calendar.php (the-events-calendar\/public\/template-tags)<br \/>\nScroll down to where the function tribe_calendar_mini_grid() is defined (line 34).<\/p>\n<p>Original:<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\nfunction tribe_calendar_mini_grid() {<br \/>\n\tset_query_var( &#8216;eventDisplay&#8217;, &#8216;bydate&#8217; );<br \/>\n\tload_template( TribeEventsTemplates::getTemplateHierarchy( &#8216;table-mini&#8217; ) );<br \/>\n}<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>Modified:<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\nfunction tribe_calendar_mini_grid($mini_cat = &#8221;) {<br \/>\n\tset_query_var( &#8216;eventDisplay&#8217;, &#8216;bydate&#8217; );<br \/>\n\tif ($mini_cat != &#8221;) {<br \/>\n\t\t\tset_query_var( &#8216;eventCat&#8217;, $mini_cat );<br \/>\n\t\t}<br \/>\n\tload_template( TribeEventsTemplates::getTemplateHierarchy( &#8216;table-mini&#8217; ) );<br \/>\n}<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\nIf there&#8217;s a category passed as a string through the variable $mini_cat, it triggers set_query_var to change the wp_query parameters used by the calendar.<\/p>\n<p>Step 2. Make mini_table.php (the-events-calendar\/views) use the category set by $mini_cat. Starting at line 28&#8230;<br \/>\nOriginal:<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n$eventPosts = tribe_get_events(array( &#8216;eventDisplay&#8217;=&gt;&#8217;month&#8217; ) );<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>Modified:<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\nif ( isset( $wp_query-&gt;query_vars[&#8216;eventCat&#8217;] ) ) {<br \/>\n\t\t$EventCategory = $wp_query-&gt;query_vars[&#8216;eventCat&#8217;];<br \/>\n\t\t$eventPosts = tribe_get_events( array( &#8216;eventCat&#8217; =&gt; $EventCategory, &#8216;eventDisplay&#8217;=&gt;&#8217;month&#8217; ) );<br \/>\n\t} else {<br \/>\n\t\t$eventPosts = tribe_get_events(array( &#8216;eventDisplay&#8217;=&gt;&#8217;month&#8217; ) );<br \/>\n\t}<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\nSave and upload. For templates, you can use:<br \/>\ntribe_calendar_mini_grid($mini_cat = &#8221;);<br \/>\nand insert the category ID number inside the quotes.<\/p>\n","protected":false},"template":"","class_list":["post-30616","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>Making the mini-calendar show specific categories -<\/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\/making-the-mini-calendar-show-specific-categories\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Making the mini-calendar show specific categories -\" \/>\n<meta property=\"og:description\" content=\"I recently installed the PRO version of The Events Calendar and was surprised to see this wasn&#8217;t a feature! The ability to have the mini calendar display a specific category of events. After researching it on the web and in these forums, I couldn&#8217;t find anything for it. I&#8217;m not sure if this has been [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/making-the-mini-calendar-show-specific-categories\/\" \/>\n<meta property=\"article:modified_time\" content=\"2015-07-07T13:26:36+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\/making-the-mini-calendar-show-specific-categories\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/making-the-mini-calendar-show-specific-categories\/\",\"name\":\"Making the mini-calendar show specific categories -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2013-01-11T05:19:52+00:00\",\"dateModified\":\"2015-07-07T13:26:36+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/making-the-mini-calendar-show-specific-categories\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/making-the-mini-calendar-show-specific-categories\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/making-the-mini-calendar-show-specific-categories\/#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\":\"Making the mini-calendar show specific categories\"}]},{\"@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":"Making the mini-calendar show specific categories -","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\/making-the-mini-calendar-show-specific-categories\/","og_locale":"en_US","og_type":"article","og_title":"Making the mini-calendar show specific categories -","og_description":"I recently installed the PRO version of The Events Calendar and was surprised to see this wasn&#8217;t a feature! The ability to have the mini calendar display a specific category of events. After researching it on the web and in these forums, I couldn&#8217;t find anything for it. I&#8217;m not sure if this has been [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/making-the-mini-calendar-show-specific-categories\/","article_modified_time":"2015-07-07T13:26:36+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\/making-the-mini-calendar-show-specific-categories\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/making-the-mini-calendar-show-specific-categories\/","name":"Making the mini-calendar show specific categories -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2013-01-11T05:19:52+00:00","dateModified":"2015-07-07T13:26:36+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/making-the-mini-calendar-show-specific-categories\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/making-the-mini-calendar-show-specific-categories\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/making-the-mini-calendar-show-specific-categories\/#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":"Making the mini-calendar show specific categories"}]},{"@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\/30616","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":1,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/30616\/revisions"}],"predecessor-version":[{"id":978776,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/30616\/revisions\/978776"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=30616"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}