Displaying events in list and calendar view

WordPress Event Management, Calendars & Registration Forums General Question Displaying events in list and calendar view

This topic contains 2 replies, has 2 voices, and was last updated by  Daniele Romeo 6 years ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #30287

    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
    #30288

    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
    #30291

    Thanks a lot Stephen, I will try and I will let you know 😉
    D

    Daniele Romeo
Viewing 3 posts - 1 through 3 (of 3 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.