ORDERING EVENTS ALPHABETICALLY

Home Forums Calendar Products Events Calendar PRO ORDERING EVENTS ALPHABETICALLY

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1098602
    anywherefest
    Participant

    Hi Team

    I have previously used this snippet in my functions.php to order events alphabetically in photo view:

    add_filter( ‘pre_get_posts’, ‘tribe_change_event_order’, 99 );
    function tribe_change_event_order( $query ) {
    if ( tribe_is_past() || tribe_is_upcoming() || tribe_is_photo() ) {
    $query->set( ‘orderby’, ‘title’ );
    $query->set( ‘order’, ‘ASC’ );
    }
    return $query;
    }

    But it no longer works. It is ordering them first by earliest date then some illogical alphabetical order after that (it’s not consistent)….any ideas?

    Many thanks
    Ally

    #1099205
    Hunter
    Moderator

    Hello Alex and welcome back 🙂

    Can you copy/paste the following snippet and replace the code you provided in your functions.php file and let me know if events are sorting alphabetically in photo view. Please test the code using the default WP theme and only our plugins activated.

    Let me know if it helps and thanks for choosing PRO!

    add_filter( 'pre_get_posts', 'tribe_change_event_order', 99 );
    function tribe_change_event_order( $query ) {
    if ( tribe_is_past() || tribe_is_upcoming() || tribe_is_photo() ) {
    $query->set( 'orderby', 'title' );
    $query->set( 'order', 'ASC' );
    }
    return $query;
    }

    #1105466
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘ORDERING EVENTS ALPHABETICALLY’ is closed to new replies.