{"id":1028410,"date":"2015-11-20T04:26:51","date_gmt":"2015-11-20T12:26:51","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/nextprev-events-on-single-page-not-going-to-correct-event\/"},"modified":"2015-11-23T07:12:00","modified_gmt":"2015-11-23T15:12:00","slug":"nextprev-events-on-single-page-not-going-to-correct-event","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/nextprev-events-on-single-page-not-going-to-correct-event\/","title":{"rendered":"Next\/Prev events on single page not going to correct event"},"content":{"rendered":"<p>The next &amp; previous links in the single event page don&#8217;t always go to the correct events<\/p>\n<p>Example if you look here<br \/>\nhttp:\/\/www.wplgroup.com\/aci\/events\/<br \/>\nAnd look at &#8220;Designing The Smart Hospital&#8221;, you can see the previous event is &#8220;The Future Of Aromatics 2016 Amsterdam The Netherlands January&#8221; and the next event is &#8220;Lignofuels 2016&#8221;<\/p>\n<p>But if you go to the event<br \/>\nhttp:\/\/www.wplgroup.com\/aci\/event\/designing-the-smart-hospital\/<br \/>\nYou can see the previous link is correct but the next link says &#8220;12th Vessel Efficiency &amp; Fuel Management Summit&#8221; not &#8220;Lignofuels 2016&#8221;<\/p>\n<p>The issue I can see is that the next event has the same date as the current event<\/p>\n<p>Looking in Main.php I can see the function get_event_link that the next &amp; previous links utilises:<\/p>\n<pre><code>\t\t\tif ( &#039;previous&#039; === $mode ) {\n\t\t\t\t$order      = &#039;DESC&#039;;\n\t\t\t\t$direction  = &#039;&lt;&#039;;\n\t\t\t} else {\n\t\t\t\t$order      = &#039;ASC&#039;;\n\t\t\t\t$direction  = &#039;&gt;&#039;;\n\t\t\t\t$mode       = &#039;next&#039;;\n\t\t\t}\n\n\t\t\t$args = array(\n\t\t\t\t&#039;post__not_in&#039;   =&gt; array( $post-&gt;ID ),\n\t\t\t\t&#039;order&#039;          =&gt; $order,\n\t\t\t\t&#039;orderby&#039;        =&gt; &quot;TIMESTAMP( $wpdb-&gt;postmeta.meta_value ) ID&quot;,\n\t\t\t\t&#039;posts_per_page&#039; =&gt; 1,\n\t\t\t\t&#039;meta_query&#039;     =&gt; array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t&#039;key&#039;     =&gt; &#039;_EventStartDate&#039;,\n\t\t\t\t\t\t&#039;value&#039;   =&gt; $post-&gt;EventStartDate,\n\t\t\t\t\t\t&#039;type&#039;    =&gt; &#039;DATETIME&#039;,\n\t\t\t\t\t\t&#039;compare&#039; =&gt; $direction,\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t&#039;key&#039;     =&gt; &#039;_EventHideFromUpcoming&#039;,\n\t\t\t\t\t\t&#039;compare&#039; =&gt; &#039;NOT EXISTS&#039;,\n\t\t\t\t\t),\n\t\t\t\t\t&#039;relation&#039;    =&gt; &#039;AND&#039;,\n\t\t\t\t),\n\t\t\t);\n<\/code><\/pre>\n<p>So the link is looking for the next event by a date that is greater (or less if previous) than the current date so will miss out the actual next event as the date is the start date is the same<\/p>\n<p>Is there a way around this?<\/p>\n<p>Cheers<br \/>\nAndy<\/p>\n","protected":false},"template":"","class_list":["post-1028410","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>Next\/Prev events on single page not going to correct 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\/nextprev-events-on-single-page-not-going-to-correct-event\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Next\/Prev events on single page not going to correct event -\" \/>\n<meta property=\"og:description\" content=\"The next &amp; previous links in the single event page don&#8217;t always go to the correct events Example if you look here http:\/\/www.wplgroup.com\/aci\/events\/ And look at &#8220;Designing The Smart Hospital&#8221;, you can see the previous event is &#8220;The Future Of Aromatics 2016 Amsterdam The Netherlands January&#8221; and the next event is &#8220;Lignofuels 2016&#8221; But if [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/nextprev-events-on-single-page-not-going-to-correct-event\/\" \/>\n<meta property=\"article:modified_time\" content=\"2015-11-23T15:12:00+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\/nextprev-events-on-single-page-not-going-to-correct-event\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/nextprev-events-on-single-page-not-going-to-correct-event\/\",\"name\":\"Next\/Prev events on single page not going to correct event -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2015-11-20T12:26:51+00:00\",\"dateModified\":\"2015-11-23T15:12:00+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/nextprev-events-on-single-page-not-going-to-correct-event\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/nextprev-events-on-single-page-not-going-to-correct-event\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/nextprev-events-on-single-page-not-going-to-correct-event\/#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\":\"Next\/Prev events on single page not going to correct 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":"Next\/Prev events on single page not going to correct 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\/nextprev-events-on-single-page-not-going-to-correct-event\/","og_locale":"en_US","og_type":"article","og_title":"Next\/Prev events on single page not going to correct event -","og_description":"The next &amp; previous links in the single event page don&#8217;t always go to the correct events Example if you look here http:\/\/www.wplgroup.com\/aci\/events\/ And look at &#8220;Designing The Smart Hospital&#8221;, you can see the previous event is &#8220;The Future Of Aromatics 2016 Amsterdam The Netherlands January&#8221; and the next event is &#8220;Lignofuels 2016&#8221; But if [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/nextprev-events-on-single-page-not-going-to-correct-event\/","article_modified_time":"2015-11-23T15:12:00+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\/nextprev-events-on-single-page-not-going-to-correct-event\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/nextprev-events-on-single-page-not-going-to-correct-event\/","name":"Next\/Prev events on single page not going to correct event -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2015-11-20T12:26:51+00:00","dateModified":"2015-11-23T15:12:00+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/nextprev-events-on-single-page-not-going-to-correct-event\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/nextprev-events-on-single-page-not-going-to-correct-event\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/nextprev-events-on-single-page-not-going-to-correct-event\/#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":"Next\/Prev events on single page not going to correct 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\/1028410","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\/1028410\/revisions"}],"predecessor-version":[{"id":1029655,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1028410\/revisions\/1029655"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1028410"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}