{"id":1607564,"date":"2018-08-28T06:56:12","date_gmt":"2018-08-28T13:56:12","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/recurring-events-not-being-created-5\/"},"modified":"2018-08-28T06:56:12","modified_gmt":"2018-08-28T13:56:12","slug":"recurring-events-not-being-created-5","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/recurring-events-not-being-created-5\/","title":{"rendered":"Recurring Events not being created"},"content":{"rendered":"<p>I am using a custom query to output Events of a certain Category on their own page for that current week. The query is as follows:<\/p>\n<p>$current_time = current_time( &#8216;Y-m-d&#8217; );<\/p>\n<p>\/\/ If today is a Sunday, use today. Else get the last Sunday<br \/>\n$sunday = &#8221;;<br \/>\nif ( (string) date( &#8216;w&#8217;, strtotime( $current_time ) ) == &#8216;0&#8217; ) {<br \/>\n\t$sunday = $current_time;<br \/>\n}<br \/>\nelse {<br \/>\n\t$sunday = date( &#8216;Y-m-d&#8217;, strtotime( &#8216;last Sunday&#8217;, strtotime( $current_time ) ) );<br \/>\n}<\/p>\n<p>\/\/ If today is a Saturday, use today. Else get the next Saturday<br \/>\n$saturday = &#8221;;<br \/>\nif ( (string) date( &#8216;w&#8217;, strtotime( $current_time ) ) == &#8216;6&#8217; ) {<br \/>\n\t$saturday = $current_time;<br \/>\n}<br \/>\nelse {<br \/>\n\t$saturday = date( &#8216;Y-m-d&#8217;, strtotime( &#8216;next Saturday&#8217;, strtotime( $current_time ) ) );<br \/>\n}<\/p>\n<p>$radio_shows = new WP_Query( array(<br \/>\n\t&#8216;post_type&#8217; =&gt; &#8216;tribe_events&#8217;,<br \/>\n\t&#8216;posts_per_page&#8217; =&gt; -1,<br \/>\n\t&#8216;eventDisplay&#8217; =&gt; &#8216;custom&#8217;,<br \/>\n\t&#8216;start_date&#8217; =&gt; $sunday . &#8216; 00:00&#8217;,<br \/>\n\t&#8216;order&#8217; =&gt; &#8216;ASC&#8217;,<br \/>\n\t&#8216;tax_query&#8217; =&gt; array(<br \/>\n\t\t&#8216;relationship&#8217; =&gt; &#8216;AND&#8217;,<br \/>\n\t\tarray(<br \/>\n\t\t\t&#8216;taxonomy&#8217; =&gt; &#8216;tribe_events_cat&#8217;,<br \/>\n\t\t\t&#8216;field&#8217; =&gt; &#8216;slug&#8217;,<br \/>\n\t\t\t&#8216;terms&#8217; =&gt; array( &#8216;radio-show&#8217; ),<br \/>\n\t\t\t&#8216;operator&#8217; =&gt; &#8216;IN&#8217;<br \/>\n\t\t),<br \/>\n\t),<br \/>\n\t&#8216;meta_query&#8217; =&gt; array(<br \/>\n\t\t&#8216;relation&#8217; =&gt; &#8216;AND&#8217;,<br \/>\n\t\tarray(<br \/>\n\t\t\t&#8216;key&#8217; =&gt; &#8216;_EventStartDate&#8217;,<br \/>\n\t\t\t&#8216;value&#8217; =&gt; $sunday . &#8216; 00:00&#8217;,<br \/>\n\t\t\t&#8216;type&#8217; =&gt; &#8216;DATETIME&#8217;,<br \/>\n\t\t\t&#8216;compare&#8217; =&gt; &#8216;&gt;=&#8217;,<br \/>\n\t\t),<br \/>\n\t\tarray(<br \/>\n\t\t\t&#8216;key&#8217; =&gt; &#8216;_EventStartDate&#8217;,<br \/>\n\t\t\t&#8216;value&#8217; =&gt; $saturday . &#8216; 23:59&#8217;,<br \/>\n\t\t\t&#8216;type&#8217; =&gt; &#8216;DATETIME&#8217;,<br \/>\n\t\t\t&#8216;compare&#8217; =&gt; &#8216;&lt;=&#8217;,<br \/>\n\t\t),<br \/>\n\t\tarray(<br \/>\n\t\t\t&#8216;key&#8217; =&gt; &#8216;_EventHideFromUpcoming&#8217;,<br \/>\n\t\t\t&#8216;compare&#8217; =&gt; &#8216;NOT EXISTS&#8217;,<br \/>\n\t\t),<br \/>\n\t),<br \/>\n) );<\/p>\n<p>This code works and has for some time. However, rarely, Recurring Events seem to not be created properly and therefore do not appear in the loop. These Events have their Recurrence set to Never End and occur Weekly and to be created 1 month in advance, so every Week they should appear within this Weekly Schedule View. We opted to have them created via the Events Calendar as a Recurring Event since, as the date passes, they are Broken from the Series and a Audio Stream is added to them.<\/p>\n<p>If it is noticed that a Event is missing from this view, Editing the Series and clicking &#8220;Update&#8221; seems to force it to work correctly.<\/p>\n<p>Is there a known bug with Recurrence Generation that we should be aware of with multiple Recurrences needing to be calculated per day\/week all at once? I am wondering if PHP is giving up at the tail end of the operation. Does it run on a Cron? Should we perhaps set up something to ping the site every hour to ensure the Recurrences are being created in smaller chunks?<\/p>\n","protected":false},"template":"","class_list":["post-1607564","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>Recurring Events not being created -<\/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\/recurring-events-not-being-created-5\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Recurring Events not being created -\" \/>\n<meta property=\"og:description\" content=\"I am using a custom query to output Events of a certain Category on their own page for that current week. The query is as follows: $current_time = current_time( &#8216;Y-m-d&#8217; ); \/\/ If today is a Sunday, use today. Else get the last Sunday $sunday = &#8221;; if ( (string) date( &#8216;w&#8217;, strtotime( $current_time ) [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/recurring-events-not-being-created-5\/\" \/>\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\/recurring-events-not-being-created-5\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/recurring-events-not-being-created-5\/\",\"name\":\"Recurring Events not being created -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2018-08-28T13:56:12+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/recurring-events-not-being-created-5\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/recurring-events-not-being-created-5\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/recurring-events-not-being-created-5\/#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\":\"Recurring Events not being created\"}]},{\"@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":"Recurring Events not being created -","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\/recurring-events-not-being-created-5\/","og_locale":"en_US","og_type":"article","og_title":"Recurring Events not being created -","og_description":"I am using a custom query to output Events of a certain Category on their own page for that current week. The query is as follows: $current_time = current_time( &#8216;Y-m-d&#8217; ); \/\/ If today is a Sunday, use today. Else get the last Sunday $sunday = &#8221;; if ( (string) date( &#8216;w&#8217;, strtotime( $current_time ) [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/recurring-events-not-being-created-5\/","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\/recurring-events-not-being-created-5\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/recurring-events-not-being-created-5\/","name":"Recurring Events not being created -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2018-08-28T13:56:12+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/recurring-events-not-being-created-5\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/recurring-events-not-being-created-5\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/recurring-events-not-being-created-5\/#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":"Recurring Events not being created"}]},{"@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\/1607564","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\/1607564\/revisions"}],"predecessor-version":[{"id":1648634,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1607564\/revisions\/1648634"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1607564"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}