1// Sort All Tours by Title
2add_filter( 'parse_query', 'sorting_archives' );
3function sorting_archives( $wp_query ) {
4 if (is_post_type_archive( 'tour' ) || is_tax()) {
5 $wp_query->set( 'orderby', 'title' );
6 $wp_query->set( 'order', 'ASC' );
7 }
8 return $wp_query;
9}
10