DIsplaying tribe events (Events Calendar) in reverse order with Mantra

  • Author
    Posts
  • #28423
    Paco Vidal

    Hi, guys!

    I’m setting up a site based in Mantra. I’m using Events Calendar Pro (Tribe). Events posts show up in the main loop, which is quite a success, but the first events to show up in the loop are not the ones I posted the last or the next events in the calendar, but the ones that will take place the last. I would like to change to reverse order and have the next events at the top, or at least the ones that have been posted the last.

    Tribe offers a solution, which is to paste this in the functions.php file:

    add_action( ‘pre_get_posts’, ‘tribe_post_date_ordering’, 51 );
    function tribe_post_date_ordering( $query ) {
    if ( $query->tribe_is_multi_posttype) {
    remove_filter( ‘posts_fields’, array( ‘TribeEventsQuery’, ‘multi_type_posts_fields’ ) );
    $query->set( ‘order’, ‘DESC’ );
    }
    }

    I tried to do it (in spite of the warning, sorry) but I got some errors in the page and Tribe’s widgets. Could you please tell me how to do it? Sorry again, I’m not a programmer at all…

Viewing 1 post (of 1 total)

The topic ‘DIsplaying tribe events (Events Calendar) in reverse order with Mantra’ is closed to new replies.