This is my IRL scenario:
I have an event recurring every saturday and sunday from June 1st to November 2nd.
This is my EM setup:
I set up an recurring event, taking place saturdays and sundays from June 1st to November 2nd.
The permalink for my newly added recurring event is mysite.com/events-recurring/my-recurring-event/
This action created a range of events with permalinks spanning from
mysite.com/events/my-recurring-event-2013-06-01/ to mysite.com/events/my-recurring-event-2013-11-02/
By default this gives me one post for every occurrence of this event in the event-list. Now I filter out the recurrences of this event by the following code in events-list.php:
// get recurrence events
$args['recurring']=1;
$evts_recurring=EM_Events::get($args);
// get non-recurrence events
$args['recurring']=0;
$evts=EM_Events::get($args);
// filter out the events that are instances of recurring events
$non_recurrence_evts = array_filter($evts,'is_no_recurrence');
// merge recurrence and non-recurring events
$evts_all= array_merge($non_recurrence_evts,$evts_recurring);
// sort them by start==start date+time
usort($evts_all,'evt_start_sort');
.
.
.
.
echo EM_Events::output( $evts_all, $args );
and in functions.php:
function is_no_recurrence($evt) {
return $evt->recurrence_id == null;
}
the format for my event-list holds the following:
<h3 class="event-title"><a href="#_EVENTURL">#_EVENTNAME</a></h3>
Now this gives me an event-list with just one post (the template for the recurring events)
the #_EVENTURL links to mysite.com/events-recurring/my-recurring-event/. When I click this link I am redirected to mysite.com/events/my-recurring-event-2013-06-01/. However I want to change this to redirect to the next not yet taken place occurrence. If I click the post today (2013-10-28) I want it to redirect to mysite.com/events/my-recurring-event-2013-11-01/ because that is the next occurrence not yet taken place.
Please excuse my poor English