Skip to content

Instantly share code, notes, and snippets.

@hlashbrooke
Created August 1, 2014 07:20
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 hlashbrooke/8793f8cf945aabfc1957 to your computer and use it in GitHub Desktop.
Save hlashbrooke/8793f8cf945aabfc1957 to your computer and use it in GitHub Desktop.
Sensei: Force lesson ordering to use the menu order attribute instead of the custom ordering available from v1.6
<?php
add_filter( 'pre_get_posts', 'sensei_lessons_use_menu_order' );
function sensei_lessons_use_menu_order( $query ) {
if( is_admin() || 'lesson' != $query->query_vars['post_type'] ) {
return;
}
$query->set( 'orderby', 'menu_order date' );
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment