Support

Home Forums Event Espresso Premium Upcoming Event page displays incorrect "previous" and "next" event links

Upcoming Event page displays incorrect "previous" and "next" event links

Posted: January 9, 2018 at 11:26 am


bdearth

January 9, 2018 at 11:26 am

I just noticed that when someone displays a current event page, there are links at the bottom to “previous” event and “next” events. I do not know where this information is drawn from, or where the settings are, but the links are incorrect. It appears they are based on the event creation date rather than the start date of the event. How can this be changed or event removed. Clearly, it is misleading.


Tony

  • Support Staff

January 10, 2018 at 5:49 am

Hi there,

Those links are not added by Event Espresso, but rather your theme.

EE events are custom post types with additional details, so your theme is outputting them as posts and using the native WP next_post_link() and previous_post_link() functions to output those links. Those functions use the post date (which is not the event date) to sort the posts.

@josh has a function that hooks into those WP functions and sorts them using the datetime dates from within EE here:

https://gist.github.com/joshfeck/a8e28b9cfecd89308fbea4c152f546c9

You can add that to a Custom Functions Plugin on your site.

Or another option is to hide them for EE events using CSS:

.single-espresso_events ul.default-wp-page li.previous, 
.single-espresso_events ul.default-wp-page li.next {
    display: none;
}

You can add that to Appearance -> Customize -> Additional CSS

Please refer to this guide for more detailed information about the CSS customizer: https://codex.wordpress.org/CSS#Custom_CSS_in_WordPress


bdearth

January 10, 2018 at 7:42 am

Ahh! That makes sense. We recently re-designed our web site. Thank you for the CSS suggestion to hide them. It works perfectly.


Tony

  • Support Staff

January 10, 2018 at 10:25 am

You’re most welcome 🙂

The support post ‘Upcoming Event page displays incorrect "previous" and "next" event links’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso