on ordering of articles in the blog.

Home Forums Ticket Products Community Tickets on ordering of articles in the blog.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1009654
    LUIGI
    Participant

    A strange question on ordering of articles in the blog.
    After I installed Tha events calendar, blog entries are sorted on the contrary, and that means from the oldest to most recent.
    Can anyone tell me how to return to the just ordering?
    Thank you

    #1009674
    Geoff
    Member

    Hi @Luigi,

    Sorry for the trouble here! This is an issue we are aware of and are working to patch up in a maintenance release as soon as possible. I don’t have an exact date for when that is coming, but I would keep your eyes posted this week.

    In the meantime, adding this snippet to your functions.php file should help. But, if not, please do watch for the release and that should address the issue.

    function fix_blog_loop_event_ordering( $sql, $query ) {
    if ( ! class_exists( 'Tribe__Events__Pro__Main' ) ) {
    return;
    }
    
    if ( ! isset( $query->query_vars[ 'is_tribe_widget' ] ) || ! $query->query_vars[ 'is_tribe_widget' ] ) {
    if ( tribe_is_month() || tribe_is_week() || tribe_is_day() ) {
    return $sql;
    }
    }
    
    if ( ! empty( $query->tribe_is_event ) || ! empty( $query->tribe_is_multi_posttype ) ) {
    if ( isset( $query->query_vars[ 'tribeHideRecurrence' ] ) && $query->query_vars[ 'tribeHideRecurrence' ] ) {
    return str_replace( 'ORDER BY EventStartDate ASC', 'ORDER BY EventStartDate DESC', $sql );
    }
    }
    
    return $sql;
    }
    
    add_filter( 'posts_request', 'fix_blog_loop_event_ordering', 20, 2 );

    Cheers!
    Geoff

    #1010652
    Geoff
    Member

    Hey there! Just a heads up that The Events Calendar 3.12.3 and The Events Calendar PRO 3.12.2 shipped just minutes ago and include a fix for the issue you reported here. Please do check it out and make the update!

    Thanks for your patience and support while we worked this out. 🙂

    Geoff

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘on ordering of articles in the blog.’ is closed to new replies.