{"id":20443,"date":"2012-06-10T16:18:40","date_gmt":"2012-06-10T23:18:40","guid":{"rendered":"http:\/\/tri.be\/support\/forums\/topic\/problems-with-tribe_get_events\/"},"modified":"2012-06-15T13:46:26","modified_gmt":"2012-06-15T20:46:26","slug":"problems-with-tribe_get_events","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/problems-with-tribe_get_events\/","title":{"rendered":"Problems with tribe_get_events"},"content":{"rendered":"<p>I have the following code in a page template, pulled almost exactly from one of the examples in the documentation:<\/p>\n<p>                global $post;<br \/>\n                $current_date = date(&#8216;j M Y&#8217;);<br \/>\n                $end_date = date(&#8216;j M Y&#8217;, strtotime(&#8216;+1 week&#8217;));<\/p>\n<p>                $all_events = tribe_get_events(<br \/>\n                    array(<br \/>\n                        &#8216;eventDisplay&#8217; =&gt; &#8216;upcoming&#8217;,<br \/>\n                        &#8216;start_date&#8217; =&gt; $current_date,<br \/>\n                        &#8216;end_date &#8216;=&gt; $end_date,<br \/>\n                        &#8216;posts_per_page&#8217; =&gt; 5,<br \/>\n                        &#8216;tax_query&#8217;=&gt; array(<br \/>\n                            array(<br \/>\n                                &#8216;taxonomy&#8217; =&gt; &#8216;tribe_events_cat&#8217;,<br \/>\n                                &#8216;field&#8217; =&gt; &#8216;slug&#8217;,<br \/>\n                                &#8216;terms&#8217; =&gt; $blog_cat<br \/>\n                            )<br \/>\n                        )<br \/>\n                    )<br \/>\n                );<\/p>\n<p>                foreach($all_events as $post) {<br \/>\n                setup_postdata($post);<br \/>\n                ?&gt;<\/p>\n<p>                    &lt;h3 class=&quot;entry-title&quot;&gt;&lt;a href=&quot;&lt;?php the_permalink(); ?&gt;&quot;&gt;&lt;?php the_title(); ?&gt;&lt;\/a&gt;&lt;\/h3&gt;<br \/>\n                    &lt;div style=&quot;margin-bottom: 1em&quot;&gt;<br \/>\n                    &lt;span class=&quot;event-date&quot;&gt;&lt;a href=&quot;&lt;?php the_permalink(); ?&gt;&quot;&gt;&lt;?php echo tribe_get_start_date($post-&gt;ID, true, &#8216;M j, Y&#8217;); ?&gt;&lt;\/a&gt;&lt;\/span&gt;<\/p>\n<p>                    &lt;?php if ( has_post_thumbnail() ) { ?&gt;<\/p>\n<p>                        &lt;div class=&quot;event-thumb&quot;&gt;<br \/>\n                            &lt;a href=&quot;&lt;?php the_permalink(); ?&gt;&quot;&gt;&lt;?php the_post_thumbnail(&#8216;thumbnail&#8217;); ?&gt;&lt;\/a&gt;<br \/>\n                        &lt;\/div&gt;<br \/>\n                        &lt;div class=&quot;event-excerpt&quot;&gt;<br \/>\n                            &lt;?php the_excerpt(); ?&gt;<br \/>\n                        &lt;\/div&gt;<\/p>\n<p>                    &lt;?php } else { ?&gt;<\/p>\n<p>                        &lt;div class=&quot;event-content&quot;&gt;<br \/>\n                            &lt;?php the_content(); ?&gt;<br \/>\n                        &lt;\/div&gt;<\/p>\n<p>                    &lt;?php } ?&gt;<br \/>\n                    &lt;\/div&gt;<\/p>\n<p>                &lt;?php } ?&gt;<br \/>\n                &lt;?php wp_reset_query(); ?&gt;<\/p>\n<p>I&#8217;ve got multiple things not working, though:<br \/>\n1. The &#8216;eventDisplay&#8217; parameter does nothing. Results are identical with or without it.<br \/>\n2. The start_date and end_date seem to do nothing either. At least the end_date doesn&#8217;t. posts_per_page number of posts are shown no matter what, even though they go past the end_date<br \/>\n3. For our recurring events, the_permalink is linked to 1970-01-01, which is a 404. It should link to the specific upcoming event instance.<\/p>\n<p>(Note also that we still haven&#8217;t been prompted to update to PRO 2.0.7 despite having updated to Free 2.0.7. See comments at https:\/\/theeventscalendar.com\/support\/forums\/topic\/release-the-events-calendarpro-2-0-7)<\/p>\n","protected":false},"template":"","class_list":["post-20443","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>Problems with tribe_get_events -<\/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\/problems-with-tribe_get_events\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Problems with tribe_get_events -\" \/>\n<meta property=\"og:description\" content=\"I have the following code in a page template, pulled almost exactly from one of the examples in the documentation: global $post; $current_date = date(&#8216;j M Y&#8217;); $end_date = date(&#8216;j M Y&#8217;, strtotime(&#8216;+1 week&#8217;)); $all_events = tribe_get_events( array( &#8216;eventDisplay&#8217; =&gt; &#8216;upcoming&#8217;, &#8216;start_date&#8217; =&gt; $current_date, &#8216;end_date &#8216;=&gt; $end_date, &#8216;posts_per_page&#8217; =&gt; 5, &#8216;tax_query&#8217;=&gt; array( array( &#8216;taxonomy&#8217; =&gt; [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/problems-with-tribe_get_events\/\" \/>\n<meta property=\"article:modified_time\" content=\"2012-06-15T20:46:26+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=\"2 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\/problems-with-tribe_get_events\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/problems-with-tribe_get_events\/\",\"name\":\"Problems with tribe_get_events -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2012-06-10T23:18:40+00:00\",\"dateModified\":\"2012-06-15T20:46:26+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/problems-with-tribe_get_events\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/problems-with-tribe_get_events\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/problems-with-tribe_get_events\/#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\":\"Problems with tribe_get_events\"}]},{\"@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":"Problems with tribe_get_events -","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\/problems-with-tribe_get_events\/","og_locale":"en_US","og_type":"article","og_title":"Problems with tribe_get_events -","og_description":"I have the following code in a page template, pulled almost exactly from one of the examples in the documentation: global $post; $current_date = date(&#8216;j M Y&#8217;); $end_date = date(&#8216;j M Y&#8217;, strtotime(&#8216;+1 week&#8217;)); $all_events = tribe_get_events( array( &#8216;eventDisplay&#8217; =&gt; &#8216;upcoming&#8217;, &#8216;start_date&#8217; =&gt; $current_date, &#8216;end_date &#8216;=&gt; $end_date, &#8216;posts_per_page&#8217; =&gt; 5, &#8216;tax_query&#8217;=&gt; array( array( &#8216;taxonomy&#8217; =&gt; [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/problems-with-tribe_get_events\/","article_modified_time":"2012-06-15T20:46:26+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/problems-with-tribe_get_events\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/problems-with-tribe_get_events\/","name":"Problems with tribe_get_events -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2012-06-10T23:18:40+00:00","dateModified":"2012-06-15T20:46:26+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/problems-with-tribe_get_events\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/problems-with-tribe_get_events\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/problems-with-tribe_get_events\/#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":"Problems with tribe_get_events"}]},{"@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\/20443","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\/20443\/revisions"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=20443"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}