Home › Forums › Calendar Products › Events Calendar PRO › Next/Prev events on single page not going to correct event
- This topic has 4 replies, 3 voices, and was last updated 10 years, 4 months ago by
Geoff.
-
AuthorPosts
-
November 20, 2015 at 4:26 am #1028410
Craig
ParticipantThe next & previous links in the single event page don’t always go to the correct events
Example if you look here
http://www.wplgroup.com/aci/events/
And look at “Designing The Smart Hospital”, you can see the previous event is “The Future Of Aromatics 2016 Amsterdam The Netherlands January” and the next event is “Lignofuels 2016”But if you go to the event
http://www.wplgroup.com/aci/event/designing-the-smart-hospital/
You can see the previous link is correct but the next link says “12th Vessel Efficiency & Fuel Management Summit” not “Lignofuels 2016”The issue I can see is that the next event has the same date as the current event
Looking in Main.php I can see the function get_event_link that the next & previous links utilises:
if ( 'previous' === $mode ) { $order = 'DESC'; $direction = '<'; } else { $order = 'ASC'; $direction = '>'; $mode = 'next'; } $args = array( 'post__not_in' => array( $post->ID ), 'order' => $order, 'orderby' => "TIMESTAMP( $wpdb->postmeta.meta_value ) ID", 'posts_per_page' => 1, 'meta_query' => array( array( 'key' => '_EventStartDate', 'value' => $post->EventStartDate, 'type' => 'DATETIME', 'compare' => $direction, ), array( 'key' => '_EventHideFromUpcoming', 'compare' => 'NOT EXISTS', ), 'relation' => 'AND', ), );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
Is there a way around this?
Cheers
AndyNovember 20, 2015 at 2:25 pm #1028778Brian
MemberHi,
Thanks for using our plugins. I can help out here.
This is actually a bug we just discovered ourselves.
I have added you to the bug report to notify you through this thread when we have an update.
Right now I do not have a work around for this issue.
However, you could try modifying the core file and changing > to >= and < to <=.
I am not 100% certain that will work, but it could be worth a shot.
Let me know if you have any follow up questions.
Thanks
November 23, 2015 at 1:28 am #1029373Craig
ParticipantHi
Thanks for the reply
I did a test with adding an equal to the direction but the previous and next come out as the same result
I’ll keep an eye out for the bug reportCheers
AndyNovember 23, 2015 at 7:12 am #1029656Brian
MemberOk well it was worth a shot.
I am going to close this ticket to new replies, but the issue is still open and we will update this ticket once we release a fix.
If you have any new questions or issues please create a new ticket and reference this one.
Thanks
December 16, 2015 at 3:13 pm #1042531Geoff
MemberHey there,
Great news–we have a fix for this issue ready and it will be shipping today in version 4.0.2. Please keep your eyes peeled for the update and let us know if any other issues pop-up in a new thread and we’d be happy to help.
Thanks again for your patience while we worked on this!
Cheers,
Geoff -
AuthorPosts
- The topic ‘Next/Prev events on single page not going to correct event’ is closed to new replies.
