Yes, but events can recur – and will still only have one page. So if you are have an event on dates X, Y and Z and you’re on that event page – which date do you pick to link to the next/previous day? X, Y or Z?
If you only have single events then there is no ambiguity. You can use the following to get the event’s start date:
$start = eo_get_the_start( DATETIMEOBJ );
$day_after = clone $start;
$day_after->modify( '+1 day' );
echo eo_get_event_archive_link( $day_after )
and similarly for the day beofre.
Thread Starter
maorb
(@maorb)
Thank you. I assum that in this case there are only single events, but there are days with only 1 event, and other days with 2 or more events, so in the calendar widget, it sometimes will lead to the single event and sometimes to the archive of the day, so in the next link I should know if the next link should be to the singular day or to the archive, is there an way to do this, or does the eo_get_event_archive_link function already handles these cases?
Thanks
No, it will also return the link to the (in this case) day page for the following day. Regardless of whether that day as 100, 1 or even 0 events.
If you wanted to link to the next day with an event, you’ll need to obtain that date using eo_get_events() and request events which start after the current day you’re on. The codex has details on that function: codex.wp-event-organiser.com/function-eo_get_events.html
Thread Starter
maorb
(@maorb)
Thank you very much for your help, I’ll take a deeper look in the codex as well.