{"id":995349,"date":"2015-08-12T06:29:26","date_gmt":"2015-08-12T13:29:26","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/event-order-the-wrong-way-around\/"},"modified":"2015-09-08T07:05:09","modified_gmt":"2015-09-08T14:05:09","slug":"event-order-the-wrong-way-around","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/event-order-the-wrong-way-around\/","title":{"rendered":"Event order the wrong way around"},"content":{"rendered":"<p>This is what I use (as per documentation)<\/p>\n<pre><code>  &lt;?php\n\n\t    $spr = array(\n\t\t    &#039;post_status&#039;=&gt;&#039;publish&#039;,\n\t\t    &#039;post_type&#039;=&gt;array(TribeEvents::POSTTYPE),\n\t\t    &#039;posts_per_page&#039;=&gt;3,\n\t\t    \/\/order by startdate from newest to oldest\n\t\t    &#039;meta_key&#039;=&gt;&#039;_EventStartDate&#039;,\n\t\t    &#039;orderby&#039;=&gt;&#039;_EventStartDate&#039;,\n\t\t    &#039;order&#039;=&gt;&#039;DESC&#039;,\n\t\t    \/\/required in 3.x\n\t\t    &#039;eventDisplay&#039;=&gt;&#039;custom&#039;,\n\t\t    \/\/query events by category\n\t\t    &#039;tax_query&#039; =&gt; array(\n\t\t\t    array(\n\t\t\t\t    &#039;taxonomy&#039; =&gt; &#039;tribe_events_cat&#039;,\n\t\t\t\t    &#039;field&#039; =&gt; &#039;slug&#039;,\n\t\t\t\t    &#039;terms&#039; =&gt; &#039;grotekerkplein&#039;,\n\t\t\t\t    &#039;operator&#039; =&gt; &#039;NOT IN&#039;\n\t\t\t    ),\n\t\t    )\n\t    );\n\n\t    $get_posts = null;\n\t    $get_posts = new WP_Query();\n\n\t    $get_posts-&gt;query($spr);\n\t    if($get_posts-&gt;have_posts()) : while($get_posts-&gt;have_posts()) : $get_posts-&gt;the_post(); ?&gt;\n\t\t    &lt;? $spr_id = get_post_thumbnail_id();\n\t\t    $spr_url = wp_get_attachment_image_src($spr_id,&#039;large&#039;);\n\t\t    $spr_url = $spr_url[0];?&gt;\n\t\t    &lt;article style=&quot;background: url(&lt;? echo $spr_url ?&gt;) center no-repeat; background-size: cover&quot;&gt;\n\n&lt;div class=&quot;meta&quot;&gt;\n\t\t   &lt;!--what--&gt;\n\t\t    &lt;? echo str_replace(\n\t\t\t    &#039;:&#039;,\n\t\t\t    &#039;&#039;,\n\t\t\t    tribe_get_event_categories($post-&gt;ID, array(&#039;label&#039;=&gt;&#039;&#039;))\n\t\t    ); ?&gt;\n\t&lt;!--when--&gt;\n\t\t       &lt;span class=&quot;when&quot;&gt;\n\t\t\t     &lt;?php\n\t\t\t     echo tribe_get_start_date($post-&gt;ID, false, &#039;j F Y&#039;); ?&gt; -\n\t\t\t\t     &lt;?php if (tribe_event_is_all_day($event_id)) {\n\t\t\t\t\t     echo &#039;Gehele dag&#039;;\n\t\t\t\t     }\n\t\t\t\t     else {\n\t\t\t\t\t     echo tribe_get_start_date($post-&gt;ID, false, &#039;H:i&#039;).&#039;-&#039;.tribe_get_end_date($post-&gt;ID, false, &#039;H:i&#039;);\n\t\t\t\t     }\n\t\t      ?&gt;\n\t\t\t    &lt;\/span&gt;\n\t&lt;h1&gt;&lt;a href=&quot;&lt;?php the_permalink(); ?&gt;&quot;&gt;&lt;?php the_title(); ?&gt; &lt;\/a&gt;&lt;\/h1&gt;\n    &lt;\/div&gt;\n&lt;\/article&gt;\n\t\t    &lt;?php\n\t    endwhile;\n\t    endif;\n\t    wp_reset_query();\n\t    ?&gt;<\/code><\/pre>\n<p>As can be seen on the homepage of the live site however the order of the events is the other way around. Please advise, thanks. <\/p>\n","protected":false},"template":"","class_list":["post-995349","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>Event order the wrong way around -<\/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\/event-order-the-wrong-way-around\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Event order the wrong way around -\" \/>\n<meta property=\"og:description\" content=\"This is what I use (as per documentation) &lt;?php $spr = array( &#039;post_status&#039;=&gt;&#039;publish&#039;, &#039;post_type&#039;=&gt;array(TribeEvents::POSTTYPE), &#039;posts_per_page&#039;=&gt;3, \/\/order by startdate from newest to oldest &#039;meta_key&#039;=&gt;&#039;_EventStartDate&#039;, &#039;orderby&#039;=&gt;&#039;_EventStartDate&#039;, &#039;order&#039;=&gt;&#039;DESC&#039;, \/\/required in 3.x &#039;eventDisplay&#039;=&gt;&#039;custom&#039;, \/\/query events by category &#039;tax_query&#039; =&gt; array( array( &#039;taxonomy&#039; =&gt; &#039;tribe_events_cat&#039;, &#039;field&#039; =&gt; &#039;slug&#039;, &#039;terms&#039; =&gt; &#039;grotekerkplein&#039;, &#039;operator&#039; =&gt; &#039;NOT IN&#039; ), ) ); $get_posts = [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/event-order-the-wrong-way-around\/\" \/>\n<meta property=\"article:modified_time\" content=\"2015-09-08T14:05:09+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\/event-order-the-wrong-way-around\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/event-order-the-wrong-way-around\/\",\"name\":\"Event order the wrong way around -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2015-08-12T13:29:26+00:00\",\"dateModified\":\"2015-09-08T14:05:09+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/event-order-the-wrong-way-around\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/event-order-the-wrong-way-around\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/event-order-the-wrong-way-around\/#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\":\"Event order the wrong way around\"}]},{\"@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":"Event order the wrong way around -","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\/event-order-the-wrong-way-around\/","og_locale":"en_US","og_type":"article","og_title":"Event order the wrong way around -","og_description":"This is what I use (as per documentation) &lt;?php $spr = array( &#039;post_status&#039;=&gt;&#039;publish&#039;, &#039;post_type&#039;=&gt;array(TribeEvents::POSTTYPE), &#039;posts_per_page&#039;=&gt;3, \/\/order by startdate from newest to oldest &#039;meta_key&#039;=&gt;&#039;_EventStartDate&#039;, &#039;orderby&#039;=&gt;&#039;_EventStartDate&#039;, &#039;order&#039;=&gt;&#039;DESC&#039;, \/\/required in 3.x &#039;eventDisplay&#039;=&gt;&#039;custom&#039;, \/\/query events by category &#039;tax_query&#039; =&gt; array( array( &#039;taxonomy&#039; =&gt; &#039;tribe_events_cat&#039;, &#039;field&#039; =&gt; &#039;slug&#039;, &#039;terms&#039; =&gt; &#039;grotekerkplein&#039;, &#039;operator&#039; =&gt; &#039;NOT IN&#039; ), ) ); $get_posts = [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/event-order-the-wrong-way-around\/","article_modified_time":"2015-09-08T14:05:09+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\/event-order-the-wrong-way-around\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/event-order-the-wrong-way-around\/","name":"Event order the wrong way around -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2015-08-12T13:29:26+00:00","dateModified":"2015-09-08T14:05:09+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/event-order-the-wrong-way-around\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/event-order-the-wrong-way-around\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/event-order-the-wrong-way-around\/#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":"Event order the wrong way around"}]},{"@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\/995349","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\/995349\/revisions"}],"predecessor-version":[{"id":995500,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/995349\/revisions\/995500"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=995349"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}