Skip to content

Instantly share code, notes, and snippets.

@jeffikus
Created October 11, 2013 08:05
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 jeffikus/6931237 to your computer and use it in GitHub Desktop.
Save jeffikus/6931237 to your computer and use it in GitHub Desktop.
Sensei Lessons Archive sort by Menu Order
/**
* 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