Created
October 11, 2013 08:05
-
-
Save jeffikus/6931237 to your computer and use it in GitHub Desktop.
Sensei Lessons Archive sort by Menu Order
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
/** | |
* sensei_filter_lessons_archive function. | |
* @access public | |
* @param mixed $wp_query | |
* @return void | |
*/ | |
function sensei_filter_lessons_archive( $wp_query ) { | |
// Handle lesson archive page | |
if ( is_post_type_archive( 'lesson' ) ) { | |
set_query_var( 'orderby', 'menu_order' ); | |
set_query_var( 'order', 'ASC' ); | |
} // End If Statement | |
} // End sensei_filter_lessons_archive() | |
add_action('pre_get_posts', 'sensei_filter_lessons_archive' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment