Created
April 3, 2015 18:03
-
-
Save joeydsmith/252f19a2668e1b344e72 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 | |
add_action( 'pre_get_posts', 'custom_get_posts' ); | |
function custom_get_posts( $query ) { | |
if( (is_category() || is_archive()) && $query->is_main_query() ) { | |
if ( $query->query_vars['post_type'] == 'staff' || $query->query_vars['post_type'] == 'stories' ) { | |
$query->query_vars['orderby'] = 'menu_order'; | |
$query->query_vars['order'] = 'ASC'; | |
} | |
if ($query->query_vars['post_type'] == 'advisory_council') { | |
$query->query_vars['orderby'] = 'title'; | |
$query->query_vars['order'] = 'ASC'; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment