Hi to everyone. I have a problem and I hope someone can help me in solving it.
When displaying the events as a list, every single date of the recurring event is shown.
But I need only the first date of each event, this is when the event starts.
In calendar view, it is nice to show all dates of one event, but I need a way to mark/highlight the first date of each event series
Has someone already faced and solved these needs?
Thanks a lot for your reply.
Dan
Daniele Romeo
Hi Daniele,
The event list shortcode as a group_events_by
option for that: http://docs.wp-event-organiser.com/shortcodes/events-list/
Calendar view is perhaps a little more tricky. You could try adding a class attribute to the first occurrence as follows:
add_filter( 'eventorganiser_event_classes', function($event_classes, $event_id, $occurrence_id){
if(eo_get_schedule_start('Y-m-d H:i:s', $event_id) == eo_get_the_start('Y-m-d H:i:s', $event_id, $occurrence_id)) {
$event_classes[] = 'is-first-occurrence';
}
return $event_classes;
}, 10, 3);
then you could use CSS to style that event. You’ll need to update an event to clear the cache before any changes to the calendar take effect.
Stephen Harris
Thanks a lot Stephen, I will try and I will let you know 😉
D
Daniele Romeo