{"id":1034181,"date":"2015-12-02T15:16:05","date_gmt":"2015-12-02T23:16:05","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/displaying-all\/"},"modified":"2015-12-03T16:13:01","modified_gmt":"2015-12-04T00:13:01","slug":"displaying-all","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/displaying-all\/","title":{"rendered":"displaying all recurrences on a single event"},"content":{"rendered":"<p>I don&#8217;t expect anyone to solve this for me.  I would, however, love some direction.<\/p>\n<p>I would love to be able to list recurring events on each single-event page.  I&#8217;ve utilized a custom function on a custom single-event template that is inside my theme&#8217;s directory, like so:<\/p>\n<p>echo display_proper_recurring_dates_ecp( get_the_ID() );<\/p>\n<p>the idea is that, if applicable, it will list all the recurring events in the series.  I&#8217;m trying to find an elegant way to do this..<\/p>\n<p>in my functions.php file is the following&#8230;. (obviously only utilized if the calendar plugin is active!)<\/p>\n<p>\tfunction display_proper_recurring_dates_ecp( $id ) {<br \/>\n\t\tif (!tribe_is_recurring_event() ) \treturn;\t\t\t\t\t\/\/ nothing to show!<br \/>\n\t\tif (is_null($id)) \t\t\t\t$id = get_the_ID();\t\t\t\/\/ if there&#8217;s an ommission<\/p>\n<p>\t\t$return .= &#8216;&lt;p&gt;There are more &#8216;.get_the_title( $id ).&#8217; courses scheduled. &#8216;;<br \/>\n\t\t$link = get_permalink( $id );<\/p>\n<p>\t\t$return .= &#8216;<a href=\"'.$link . '\/all\">See All.<\/a>&lt;\/p&gt;&#8217;;<\/p>\n<p>\t\tglobal $post;<br \/>\n\t\t$myStartDate = sp_get_start_date ( $id, true, &#8216;D M j Y G:i:s&#8217;);<br \/>\n\t\t$this_event_unix = date(&#8216;U&#8217;, strtotime( $myStartDate ) ) ;<\/p>\n<p>\t\t$start_dates = tribe_get_recurrence_start_dates ( $post );<br \/>\n\t\tforeach($start_dates as $start_date){<\/p>\n<p>\t\t\t$event_start_unix = date(&#8216;U&#8217;, strtotime( $start_date ) ) ;<br \/>\n\t\t\tif ($event_start_unix == $this_event_unix) continue;\t\t\/\/ skip the present event recurrnce<br \/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/ since its the one we&#8217;re looking at..<br \/>\n\t\t\t$event_year = date(&#8216;Y&#8217;, strtotime( $start_date ) ) ;\t\t\/\/ get the present year, and event<br \/>\n\t\t\t$this_year  = date(&#8216;Y&#8217;) ;\t\t\t\t\t\t\t\t\/\/ year, use to determine displaying<br \/>\n\t\t\t$date_format = tribe_get_date_format( $event_year == $this_year ? false : true );<\/p>\n<p>\t\t\t$event_link = get_permalink();<\/p>\n<p>\t\t\t$event_end_unix = $event_start_unix + (int)get_post_meta( $id, &#8216;_EventDuration&#8217;, true);<\/p>\n<p>\t\t\t$return .= &#8216;&lt;p&gt;<a href=\"'.$event_link.'\">&#8216; .<br \/>\n\t\t\t\t\t\t\tdate($date_format, $event_start_unix) .<br \/>\n\t\t\t\t\t\t\t &#8216; &#8211; &#8216; . date($date_format,  $event_end_unix ).<br \/>\n\t\t\t\t\t\t&#8216;<\/a>&lt;\/p&gt;&#8217;;<\/p>\n<p>\t\t}<\/p>\n<p>\t\treturn $return;<br \/>\n\t}<\/p>\n<p>Really struggling with this one, and would love a point in the right direction.  As you can see, I am familiar with pulling the meta data from the postID, however, its difficult for me to decipher how to pull individual listings and arrive at a list of applicable links.<\/p>\n<p>I would really appreciate any help you can give me &#8211; and I&#8217;m happy to share whatever I figure out with the development team&#8230;  If its worthy of course, LOL<\/p>\n<p>Thanks!  Allan<\/p>\n","protected":false},"template":"","class_list":["post-1034181","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>displaying all recurrences on a single event -<\/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\/displaying-all\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"displaying all recurrences on a single event -\" \/>\n<meta property=\"og:description\" content=\"I don&#8217;t expect anyone to solve this for me. I would, however, love some direction. I would love to be able to list recurring events on each single-event page. I&#8217;ve utilized a custom function on a custom single-event template that is inside my theme&#8217;s directory, like so: echo display_proper_recurring_dates_ecp( get_the_ID() ); the idea is that, [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/displaying-all\/\" \/>\n<meta property=\"article:modified_time\" content=\"2015-12-04T00:13:01+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\/displaying-all\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/displaying-all\/\",\"name\":\"displaying all recurrences on a single event -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2015-12-02T23:16:05+00:00\",\"dateModified\":\"2015-12-04T00:13:01+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/displaying-all\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/displaying-all\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/displaying-all\/#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\":\"Community Events\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/community-events\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"displaying all recurrences on a single event\"}]},{\"@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":"displaying all recurrences on a single event -","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\/displaying-all\/","og_locale":"en_US","og_type":"article","og_title":"displaying all recurrences on a single event -","og_description":"I don&#8217;t expect anyone to solve this for me. I would, however, love some direction. I would love to be able to list recurring events on each single-event page. I&#8217;ve utilized a custom function on a custom single-event template that is inside my theme&#8217;s directory, like so: echo display_proper_recurring_dates_ecp( get_the_ID() ); the idea is that, [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/displaying-all\/","article_modified_time":"2015-12-04T00:13:01+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\/displaying-all\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/displaying-all\/","name":"displaying all recurrences on a single event -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2015-12-02T23:16:05+00:00","dateModified":"2015-12-04T00:13:01+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/displaying-all\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/displaying-all\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/displaying-all\/#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":"Community Events","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/community-events\/"},{"@type":"ListItem","position":5,"name":"displaying all recurrences on a single event"}]},{"@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\/1034181","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\/1034181\/revisions"}],"predecessor-version":[{"id":1034606,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1034181\/revisions\/1034606"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1034181"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}