Created
September 14, 2017 21:39
-
-
Save nefeline/fdf7bf7be695dd4a54d6c0796bcf1b20 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This function lists the Events Alphabetically | |
*/ | |
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; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment