{"id":1070269,"date":"2016-02-09T07:17:21","date_gmt":"2016-02-09T15:17:21","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/removing-expired-events\/"},"modified":"2016-02-24T08:35:05","modified_gmt":"2016-02-24T16:35:05","slug":"removing-expired-events","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/removing-expired-events\/","title":{"rendered":"Removing expired events"},"content":{"rendered":"<p>My question is 2 fold. <\/p>\n<p>1. Is there a way to have expired events removed from the calendar after X amount of time? <\/p>\n<p>2. I created a list style of events that show the next upcoming events and it sits on top of my calendar as shown here below (\/upcoming-events). <\/p>\n<p><code><\/p>\n<p>tribe_get_template_part( 'month\/upcoming-events' );<\/p>\n<p>\/\/ Tribe Bar<br \/>\ntribe_get_template_part( 'modules\/bar' );<\/p>\n<p>\/\/ Main Events Content<br \/>\ntribe_get_template_part( 'month\/content' );<\/p>\n<p>do_action( 'tribe_events_after_template' );<\/p>\n<p><\/code><\/p>\n<p>In this event view it&#8217;s showing events that have past already in January, e.g. http:\/\/cl.ly\/1d1F3A0r2F2S<\/p>\n<p>Is there a way to make it so that it doesn&#8217;t show these events since they&#8217;ve already past? Below is my code for the upcoming events list. <\/p>\n<p><code><br \/>\nglobal $post;<\/p>\n<p>\/\/ Retrieve the next 5 upcoming events<br \/>\n$events = tribe_get_events( array(<br \/>\n    'posts_per_page' =&gt; 5,<br \/>\n    \/\/'start_date' =&gt; new DateTime()<br \/>\n) );<\/p>\n<p> echo '&lt;ul id=\"upcoming-events\"&gt;'; <\/p>\n<p>\/\/ Loop through the events: set up each one as<br \/>\n\/\/ the current post then use template tags to<br \/>\n\/\/ display the title and content<br \/>\nforeach ( $events as $post ) {<br \/>\n    setup_postdata( $post );<\/p>\n<p>    echo '<\/p>\n<li>';\n<p>    \/\/ This time, let's throw in an event-specific<br \/>\n    \/\/ template tag to show the date after the title!<br \/>\n    echo '<a href=\"' . get_permalink() . '\">'; echo the_title();  echo '<\/a>';<br \/>\n    echo '&lt;br \/&gt;';<br \/>\n    echo '<strong>When: <\/strong>' . tribe_get_start_date();<br \/>\n    echo '&lt;br \/&gt;';<br \/>\n    echo '<strong>Where: <\/strong>' . tribe_get_venue(); if (tribe_get_city() !='') : echo ' - ' . tribe_get_city();  endif; if (tribe_get_state() !='') :  echo ', ' . tribe_get_state(); endif;<br \/>\n    \/\/echo tribe_get_city(); <\/p>\n<p>    echo '&lt;br \/&gt;'; <\/p>\n<p>    echo '<\/li>\n<p>';<br \/>\n}<\/p>\n<p>echo '<\/ul>\n<p>';<\/p>\n<p>?&gt;<\/p>\n<p><a href=\"\/events\/list\/\">View all upcoming events<\/a><br \/>\n<\/code><\/p>\n","protected":false},"template":"","class_list":["post-1070269","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>Removing expired 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\/removing-expired-events\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Removing expired events -\" \/>\n<meta property=\"og:description\" content=\"My question is 2 fold. 1. Is there a way to have expired events removed from the calendar after X amount of time? 2. I created a list style of events that show the next upcoming events and it sits on top of my calendar as shown here below (\/upcoming-events). tribe_get_template_part( &#039;month\/upcoming-events&#039; ); \/\/ Tribe [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/removing-expired-events\/\" \/>\n<meta property=\"article:modified_time\" content=\"2016-02-24T16:35:05+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\/removing-expired-events\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/removing-expired-events\/\",\"name\":\"Removing expired events -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2016-02-09T15:17:21+00:00\",\"dateModified\":\"2016-02-24T16:35:05+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/removing-expired-events\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/removing-expired-events\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/removing-expired-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\":\"Removing expired 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":"Removing expired 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\/removing-expired-events\/","og_locale":"en_US","og_type":"article","og_title":"Removing expired events -","og_description":"My question is 2 fold. 1. Is there a way to have expired events removed from the calendar after X amount of time? 2. I created a list style of events that show the next upcoming events and it sits on top of my calendar as shown here below (\/upcoming-events). tribe_get_template_part( 'month\/upcoming-events' ); \/\/ Tribe [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/removing-expired-events\/","article_modified_time":"2016-02-24T16:35:05+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\/removing-expired-events\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/removing-expired-events\/","name":"Removing expired events -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2016-02-09T15:17:21+00:00","dateModified":"2016-02-24T16:35:05+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/removing-expired-events\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/removing-expired-events\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/removing-expired-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":"Removing expired 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\/1070269","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\/1070269\/revisions"}],"predecessor-version":[{"id":1070418,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1070269\/revisions\/1070418"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1070269"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}