Forum Replies Created

Viewing 1 replies (of 1 total)
  • Thread Starter vlaja

    (@vlaja)

    Hi guys,

    @duisterdenhaag for some reason, the link with your solution is not accessible at the moment so I am unable to see the fix. However, I’ve managed to create a fix in the meantime, this is my code:

    <?php
    $wppsCurrentEvent = do_shortcode('[event]#_EVENTDATES[/event]');
    $wppsAllEventsDates = explode(",", do_shortcode('[events_list scope="all" limit="1000"]#_EVENTDATES,[/events_list]'));
    if(in_array($wppsCurrentEvent, $wppsAllEventsDates)){
    $wppsNextEventInArray = array_search($wppsCurrentEvent, $wppsAllEventsDates) + 1;
    $wppsPrevEventInArray = array_search($wppsCurrentEvent, $wppsAllEventsDates) - 1;
    }
    $wppsNextEvent = EM_Events::output(array('scope'=>'all', 'limit'=>1, 'offset'=> $wppsNextEventInArray));
    $wppsPrevEvent = EM_Events::output(array('scope'=>'all', 'limit'=>1, 'offset'=> $wppsPrevEventInArray)); ?>

    $wppsNextEvent and $wppsPrevEvent variables just need to be printed in order for prev and next links based on event date to be displayed.

    • This reply was modified 5 years ago by vlaja.
Viewing 1 replies (of 1 total)