{"id":1109261,"date":"2016-05-01T02:39:50","date_gmt":"2016-05-01T09:39:50","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/trying-to-sort-events-by-date-in-module\/"},"modified":"2016-05-17T09:35:03","modified_gmt":"2016-05-17T16:35:03","slug":"trying-to-sort-events-by-date-in-module","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/trying-to-sort-events-by-date-in-module\/","title":{"rendered":"TRying to sort events by date in module"},"content":{"rendered":"<p>Hi there,<br \/>\nI have a module on the frontpage of my site which provides a feed of upcoming events.<br \/>\nAt the moment, it is not correctly displaying events by event date and it is showing expired events as well.<\/p>\n<p>http:\/\/b4-business.white-staging.co.uk\/<\/p>\n<p>It&#8217;s the member events module at the bottom.<\/p>\n<p>Could you help me identify the problem with my code?<\/p>\n<p>&lt;?php<\/p>\n<p>extract(array(<br \/>\n    &#8216;events&#8217; =&gt; []<br \/>\n), EXTR_SKIP);<\/p>\n<p>$heading = (($heading) ? $heading : &#8216;Member Events&#8217;);<br \/>\n?&gt;<\/p>\n<p>&lt;div class=&#8221;col-xxs-12 col-xs-6 col-md-3 isotope-item&#8221;&gt;<\/p>\n<p>    &lt;div class=&#8221;panel panel-default module module-member-event&#8221;&gt;<\/p>\n<p>        &lt;div class=&#8221;panel-heading&#8221;&gt;<\/p>\n<p>            <a href=\"\/event-listings\">See All<\/a><\/p>\n<h3>&lt;?php echo $heading; ?&gt;<\/h3>\n<p>        &lt;\/div&gt;<\/p>\n<p>        &lt;div class=&#8221;list-group&#8221; data-compare&gt;<\/p>\n<p>            &lt;?php $args = array( &#8216;orderby&#8217; =&gt; &#8216;date&#8217;); foreach($events as $event ): ?&gt;<\/p>\n<p>                <a>&#8221; class=&#8221;list-group-item&#8221;&gt;<br \/>\n                    &lt;?php render_template(&#8216;subtitle-with-date&#8217;, array(&#8216;text&#8217; =&gt; $event[&#8216;title&#8217;], &#8216;date&#8217; =&gt; $event[&#8216;date&#8217;])); ?&gt;<br \/>\n                <\/a><\/p>\n<p>            &lt;?php endforeach; ?&gt;<\/p>\n<p>        &lt;\/div&gt;<\/p>\n<p>    &lt;\/div&gt;<\/p>\n<p>&lt;\/div&gt;<\/p>\n","protected":false},"template":"","class_list":["post-1109261","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>TRying to sort events by date in module -<\/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\/trying-to-sort-events-by-date-in-module\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"TRying to sort events by date in module -\" \/>\n<meta property=\"og:description\" content=\"Hi there, I have a module on the frontpage of my site which provides a feed of upcoming events. At the moment, it is not correctly displaying events by event date and it is showing expired events as well. http:\/\/b4-business.white-staging.co.uk\/ It&#8217;s the member events module at the bottom. Could you help me identify the problem [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/trying-to-sort-events-by-date-in-module\/\" \/>\n<meta property=\"article:modified_time\" content=\"2016-05-17T16:35:03+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\/trying-to-sort-events-by-date-in-module\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/trying-to-sort-events-by-date-in-module\/\",\"name\":\"TRying to sort events by date in module -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2016-05-01T09:39:50+00:00\",\"dateModified\":\"2016-05-17T16:35:03+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/trying-to-sort-events-by-date-in-module\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/trying-to-sort-events-by-date-in-module\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/trying-to-sort-events-by-date-in-module\/#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\":\"TRying to sort events by date in module\"}]},{\"@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":"TRying to sort events by date in module -","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\/trying-to-sort-events-by-date-in-module\/","og_locale":"en_US","og_type":"article","og_title":"TRying to sort events by date in module -","og_description":"Hi there, I have a module on the frontpage of my site which provides a feed of upcoming events. At the moment, it is not correctly displaying events by event date and it is showing expired events as well. http:\/\/b4-business.white-staging.co.uk\/ It&#8217;s the member events module at the bottom. Could you help me identify the problem [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/trying-to-sort-events-by-date-in-module\/","article_modified_time":"2016-05-17T16:35:03+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\/trying-to-sort-events-by-date-in-module\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/trying-to-sort-events-by-date-in-module\/","name":"TRying to sort events by date in module -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2016-05-01T09:39:50+00:00","dateModified":"2016-05-17T16:35:03+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/trying-to-sort-events-by-date-in-module\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/trying-to-sort-events-by-date-in-module\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/trying-to-sort-events-by-date-in-module\/#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":"TRying to sort events by date in module"}]},{"@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\/1109261","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\/1109261\/revisions"}],"predecessor-version":[{"id":1109439,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1109261\/revisions\/1109439"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1109261"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}