Custom order

This topic contains 2 replies, has 2 voices, and was last updated by  AK 5 years, 1 month ago.

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

    Hi,

    We have multiple dates for most events.
    Is it possible to display an event list that shows all events that has upcoming dates, first (sorted by nearest first) and after that show all events that doesn´t have any upcoming events anymore?
    I have been trying all kinds of things but can´t find a good solutions
    … I was hoping something like this would work “ORDER BY (CASE WHEN DATE(StartDate) < DATE(CURDATE()) THEN 1 ELSE 0 END) DESC, StartDate ASC” …in a posts_orderby -filter.
    but I fear I´m completely stuck now

    Event list should be “series” (I´m using eo_get_the_occurrences_of() to display all dates for each “event spot”)

    Thanks!

    AK
    #36578

    Hi,

    I think a better option might be to use different shortcodes? One for future events, and one for past events.

    Future events:

    [eo_events event_end_after="today" group_events_by="series"]
    

    Past events:

    [eo_events event_end_before="today" group_events_by="series"]
    

    But I think you might end up with events in both shortcodes if they have past and future occurrences.

    What you could do is use eo_interval="expired" to get only events with no future occurrences:

    [eo_events group_events_by="series"  eo_interval="expired"]
    
    Stephen Harris
    #36597

    Thank you Stephen,

    That “expired” arg is really useful, I didn´t know it existed

    Thanks!

    AK
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.