Skip to content

Instantly share code, notes, and snippets.

@nefeline
Created September 14, 2017 21:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nefeline/fdf7bf7be695dd4a54d6c0796bcf1b20 to your computer and use it in GitHub Desktop.
Save nefeline/fdf7bf7be695dd4a54d6c0796bcf1b20 to your computer and use it in GitHub Desktop.
<?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