-
-
Save jesseeproductions/e6de697de04674a85e86 to your computer and use it in GitHub Desktop.
The Events Calender - Custom Orderby Events in List View ByTitle
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
/* | |
* 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