{"id":968335,"date":"2015-06-09T18:58:28","date_gmt":"2015-06-10T01:58:28","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tribe_events_cat-query-and-tribe_events_list_the_date_headers\/"},"modified":"2015-06-15T07:39:27","modified_gmt":"2015-06-15T14:39:27","slug":"tribe_events_cat-query-and-tribe_events_list_the_date_headers","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tribe_events_cat-query-and-tribe_events_list_the_date_headers\/","title":{"rendered":"tribe_events_cat query and tribe_events_list_the_date_headers()"},"content":{"rendered":"<p>Hi <\/p>\n<p>I&#8217;m having a lot of fun with your plugin and have gone a very long way without any help due to good support forums and quite a lot of documentation on the web&#8230;<\/p>\n<p>Taking some time all the same.<\/p>\n<p>This may be beyond your remit as I&#8217;m doing some fairly extensive theming of the events calendar but I&#8217;m hoping you could at least point me in the right direction with an area that doesn&#8217;t have much documentation at all&#8230;<\/p>\n<p>I&#8217;ve written a query using tribe_events_cat to return all events in a category slug called club_event where the category id =23. I&#8217;ve succesfully tapped into parts of your code from list\/content.php and list\/loop.php to return a list of events. I&#8217;m outputting different queries on different tabs of my events page using the month and list view quite successfully.<\/p>\n<p>The page is at:<br \/>\nhttp:\/\/trial.pow-london.com\/?post_type=tribe_events<br \/>\nand outputs all events using the month view but events by catyegory slug using list view.<\/p>\n<p>This all seems to be working fine except that when tribe_events_list_the_date_headers() is called it returns the month and year header for each event listing rather than as a divider between months.<\/p>\n<p>I&#8217;m wondering if I need an extra field in my array for tribe_events_cat (perhaps _EventStartDate) for tribe_events_list_the_date_headers() to properly process the month dividers.<\/p>\n<p>In other words What fields within the events calendar&#8217;s standard queries does tribe_events_list_the_date_headers() require to operate correctly?<\/p>\n<p>Am I on the right track here? The code for the &#8216;club tab&#8217; is shown below<\/p>\n<p>Many thanks in advance for any help you may be able to give or even pointers in the right direction.<\/p>\n<p>I&#8217;m not a hardcore php coder <\/p>\n<p>Simon Landin<\/p>\n<p>&lt;?php<br \/>\n\/\/ example args<br \/>\n$args_club = array (<br \/>\n  &#8216;paged&#8217; =&gt; 1,<br \/>\n  &#8216;posts_per_page&#8217; =&gt; &#8216;-1&#8217;,<br \/>\n  &#8216;offset&#8217; =&gt; 0,<br \/>\n  &#8216;post_status&#8217; =&gt; &#8216;publish&#8217;,<br \/>\n  &#8216;ignore_sticky_posts&#8217; =&gt; 0,<br \/>\n  &#8216;orderby&#8217; =&gt; &#8216;date&#8217;,<br \/>\n  &#8216;order&#8217; =&gt; &#8216;ASC&#8217;,<br \/>\n  &#8216;tax_query&#8217; =&gt;<br \/>\n  array (<br \/>\n    0 =&gt;<br \/>\n    array (<br \/>\n      &#8216;taxonomy&#8217; =&gt; &#8216;tribe_events_cat&#8217;,<br \/>\n      &#8216;field&#8217; =&gt; &#8216;id&#8217;,<br \/>\n\t  &#8216;terms&#8217; =&gt;<br \/>\n      array (<br \/>\n        0 =&gt; 23,<br \/>\n      ),<br \/>\n      &#8216;operator&#8217; =&gt; &#8216;IN&#8217;,<br \/>\n      &#8216;include_children&#8217; =&gt; false,<br \/>\n    ),<br \/>\n  ),<br \/>\n  &#8216;post_type&#8217; =&gt;<br \/>\n  array (<br \/>\n    &#8216;tribe_events&#8217; =&gt; &#8216;tribe_events&#8217;,<br \/>\n  ),<br \/>\n);?&gt;<\/p>\n<p>&lt;?php<\/p>\n<p>\/\/ the query<br \/>\n $the_club_query = new WP_Query( $args_club );<br \/>\n if ( $the_club_query-&gt;have_posts() ) : ?&gt;<br \/>\n&lt;?php do_action( &#8216;tribe_events_before_loop&#8217; ); ?&gt;<\/p>\n<p>\t&lt;!&#8211; start of the loop &#8211;&gt;<br \/>\n\t&lt;?php while ( $the_club_query-&gt;have_posts() ) : $the_club_query-&gt;the_post(); ?&gt;<\/p>\n<p>\t\t&lt;?php do_action( &#8216;tribe_events_inside_before_loop&#8217; ); ?&gt;<\/p>\n<p>\t\t&lt;!&#8211; Month \/ Year Headers &#8211;&gt;<br \/>\n\t\t&lt;?php tribe_events_list_the_date_headers(); ?&gt;<\/p>\n<p>\t\t&lt;!&#8211; Event  &#8211;&gt;<br \/>\n\t\t&lt;div id=&#8221;post-&lt;?php the_ID() ?&gt;&#8221; class=&#8221;&lt;?php tribe_events_event_classes() ?&gt;&#8221;&gt;<br \/>\n\t\t\t&lt;?php tribe_get_template_part( &#8216;list\/single&#8217;, &#8216;event&#8217; ) ?&gt;<br \/>\n\t\t&lt;\/div&gt;&lt;!&#8211; .hentry .vevent &#8211;&gt;<\/p>\n<p>\t\t&lt;?php do_action( &#8216;tribe_events_inside_after_loop&#8217; ); ?&gt;<br \/>\n\t&lt;?php endwhile; ?&gt;&lt;!&#8211; end of the loop &#8211;&gt;<\/p>\n<p>\t\t\t&lt;?php do_action( &#8216;tribe_events_after_loop&#8217; ); ?&gt;<br \/>\n\t&lt;!&#8211; put pagination functions here &#8211;&gt;<br \/>\n\t&lt;?php wp_reset_postdata(); ?&gt;<\/p>\n<p>&lt;?php else:  ?&gt;<\/p>\n<p>&lt;p&gt;&lt;?php _e( &#8216;Sorry, there are no club event listings at present.&#8217; ); ?&gt;&lt;\/p&gt;<\/p>\n<p>&lt;?php endif; ?&gt;<\/p>\n","protected":false},"template":"","class_list":["post-968335","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>tribe_events_cat query and tribe_events_list_the_date_headers() -<\/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\/tribe_events_cat-query-and-tribe_events_list_the_date_headers\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"tribe_events_cat query and tribe_events_list_the_date_headers() -\" \/>\n<meta property=\"og:description\" content=\"Hi I&#8217;m having a lot of fun with your plugin and have gone a very long way without any help due to good support forums and quite a lot of documentation on the web&#8230; Taking some time all the same. This may be beyond your remit as I&#8217;m doing some fairly extensive theming of the [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tribe_events_cat-query-and-tribe_events_list_the_date_headers\/\" \/>\n<meta property=\"article:modified_time\" content=\"2015-06-15T14:39:27+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=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tribe_events_cat-query-and-tribe_events_list_the_date_headers\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tribe_events_cat-query-and-tribe_events_list_the_date_headers\/\",\"name\":\"tribe_events_cat query and tribe_events_list_the_date_headers() -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2015-06-10T01:58:28+00:00\",\"dateModified\":\"2015-06-15T14:39:27+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tribe_events_cat-query-and-tribe_events_list_the_date_headers\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tribe_events_cat-query-and-tribe_events_list_the_date_headers\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tribe_events_cat-query-and-tribe_events_list_the_date_headers\/#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\":\"tribe_events_cat query and tribe_events_list_the_date_headers()\"}]},{\"@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":"tribe_events_cat query and tribe_events_list_the_date_headers() -","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\/tribe_events_cat-query-and-tribe_events_list_the_date_headers\/","og_locale":"en_US","og_type":"article","og_title":"tribe_events_cat query and tribe_events_list_the_date_headers() -","og_description":"Hi I&#8217;m having a lot of fun with your plugin and have gone a very long way without any help due to good support forums and quite a lot of documentation on the web&#8230; Taking some time all the same. This may be beyond your remit as I&#8217;m doing some fairly extensive theming of the [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tribe_events_cat-query-and-tribe_events_list_the_date_headers\/","article_modified_time":"2015-06-15T14:39:27+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tribe_events_cat-query-and-tribe_events_list_the_date_headers\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tribe_events_cat-query-and-tribe_events_list_the_date_headers\/","name":"tribe_events_cat query and tribe_events_list_the_date_headers() -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2015-06-10T01:58:28+00:00","dateModified":"2015-06-15T14:39:27+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tribe_events_cat-query-and-tribe_events_list_the_date_headers\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/tribe_events_cat-query-and-tribe_events_list_the_date_headers\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tribe_events_cat-query-and-tribe_events_list_the_date_headers\/#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":"tribe_events_cat query and tribe_events_list_the_date_headers()"}]},{"@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\/968335","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":2,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/968335\/revisions"}],"predecessor-version":[{"id":973912,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/968335\/revisions\/973912"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=968335"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}