Created
August 1, 2014 07:20
-
-
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
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_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