Viewing 1 replies (of 1 total)
  • Plugin Author Stephen Harris

    (@stephenharris)

    Default templates don’t use those functions for that very reason. Its possible to filter the next/previous post (or create alternative functions) – but the reason for not implementing is that with recurring events, all occurrences point to the same page. So the the ‘next’ event doesn’t make any sense (next one to which occurrence?). With recurring events there’s no logical way of pointing to the ‘next event’ without creating an infinite loop of links.

    E.g:
    Event A – 1st July
    Event B – 2nd July
    Event A – 3st July
    Event B – 4nd July
    Event C – 5th July
    Event D – 6th July

    (Its now 17th June). On “Event A”s page, the ‘next event’ could be considered to be Event B. But the on “Event B”s page it could be considered to be Event A. And so on – C and D wouldn’t be appear as links.

    If you’ve only got single occurrence events, then it makes sense – in those instances you can filter get_adjacent_post()‘s SQL query, or filter the output of the next_post_link() / previous_post_link(). Or better still, roll your own function using eo_get_event() to get the next event, after the ‘current event’, which is not the current event.

    Something like the following might work:

    $next = eo_get_event(
                    'numberposts' => 1,
                    'event_start_after' => eo_get_the_start( 'Y-m-d' ),
                    'post__not_in' => array( get_the_ID() ).
                 );
Viewing 1 replies (of 1 total)
  • The topic ‘Functionality next_post_link along event dates’ is closed to new replies.