Skip to content

Instantly share code, notes, and snippets.

@danjjohnson
Created August 12, 2014 07:10
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 danjjohnson/5e465e33a46851e1e3d8 to your computer and use it in GitHub Desktop.
Save danjjohnson/5e465e33a46851e1e3d8 to your computer and use it in GitHub Desktop.
Change order of course catgories
function change_course_taxonomy_order( $query ) {
// Are we querying a course-category archive?
if ( is_tax( 'course-category' ) && $query->is_main_query() ) {
$query->set( 'posts_per_page', '6' );
$query->set( 'orderby', 'title' );
$query->set( 'order', 'ASC' );
}
}
add_action( 'pre_get_posts', 'change_course_taxonomy_order' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment