Change Sort Order of Events on My Events page

Home Forums Calendar Products Community Events Change Sort Order of Events on My Events page

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1560425
    mattbrett
    Participant

    Is it possible to change the sort order of events on the My Events (/events/community/list) page? Currently, it shows the furthest away events first, and the most recent at the end. Shouldn’t it be reversed, like how events are listed everywhere else?

    Looking at the /community/event-list.php template, I don’t see any query vars. All I want to do is change the order from ASC to DESC.

    #1561202
    Victor
    Keymaster

    Hi Matt!

    Thanks for getting in touch with us!

    First, please let me note that we are fairly limited in how much support we can give for custom development questions like that.

    That said, we always like helping out and at least point users into the right direction as much possible.

    You can customize that query by using the tribe_ce_my_events_query filter available. Try placing the following code into your functions.php file:

    add_filter('tribe_ce_my_events_query', 'my_custom_ce_my_events_query');
    function my_custom_ce_my_events_query ( $args ) {
    $args['order'] = 'ASC';
    return $args;
    }

    Does it work for you? Let me know about it.

    Best,
    Victor

    #1561215
    mattbrett
    Participant

    Exactly what I was after, thank you very much!

    I did look for the filter, but obviously didn’t use relevant terms.

    #1561629
    Victor
    Keymaster

    You are welcome Matt!

    Thanks for following up to let us know it worked out 🙂

    Since you marked this resolved, I’ll go ahead and close this thread, but feel free to open a new topic if anything comes up and we’ll be happy to help.

    Cheers,
    Victor

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Change Sort Order of Events on My Events page’ is closed to new replies.