Viewing 3 replies - 1 through 3 (of 3 total)
  • Brook

    (@brook-tribe)

    Howdy Alex,

    If you just want to reverse the order as it appears on the page then that is going to be easy. This snippet reverse the order for the past events pages, with slight modification you could cause it to reverse the order on other pages including the upcoming and events widget ones.

    https://gist.github.com/elimn/0be6c4cbcf80b3721c81

    However, that reverses the page order. Say you have events from now until December in your calendar, and the first page of the calendar shows events from Sept – Oct. The above will reverse the first page to be Oct – Sept. perhaps you would rather it show Dec – Nov though. That being the case, you would have to write your own snippet. One which taps into pre_get_posts and targets the upcoming event query could do that, you could reverse the SQL sort order. However, this not an easy thing to do at all and will take a lot of trial and error.

    I hope that snippet helps. Happy calendaring!

    – Brook

    Thread Starter alexWP333

    (@alexwp333)

    Thanks very much Brook.

    I looked at the code snippet that you sent me the link to, for reversing the order of the past events pages.

    Can you tell me, specifically, what slight modifications I’d need to make to this code snippet, so that it reverses the order of the events widget that’s on the Home page?

    Hey alexWP333,

    Can you take a look to this answer where Brook explains how to use this code for widgets? https://theeventscalendar.com/support/forums/topic/display-past-events-in-reverse-order-snippet/#dl_post-922292

    Please let me know if you manage to get that working,
    Best,
    Nico

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Reversing the Order of Upcoming Events’ is closed to new replies.