Skip to content

Instantly share code, notes, and snippets.

@jesseeproductions
Last active August 29, 2015 14:08
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 jesseeproductions/e6de697de04674a85e86 to your computer and use it in GitHub Desktop.
Save jesseeproductions/e6de697de04674a85e86 to your computer and use it in GitHub Desktop.
The Events Calender - Custom Orderby Events in List View ByTitle
/*
* The Events Calender - Custom Orderby Events in List View ByTitle
* http://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters
*/
add_filter( 'pre_get_posts', 'tribe_change_event_order_list_view', 99 );
function tribe_change_event_order_list_view( $query ) {
if ( tribe_is_past() || tribe_is_upcoming() ) {
$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