Skip to content

Instantly share code, notes, and snippets.

@amdrew
Last active January 3, 2016 13:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save amdrew/8468347 to your computer and use it in GitHub Desktop.
Save amdrew/8468347 to your computer and use it in GitHub Desktop.
Order downloads alphabetically on category pages in Easy Digital Downloads
<?php
function sumobi_edd_order_category_downloads( $query ) {
if ( is_admin() || ! $query->is_main_query() )
return;
if( $query->is_tax( 'download_category' ) ) {
$query->set( 'orderby', 'title' );
$query->set( 'order', 'ASC' );
}
return;
}
add_action( 'pre_get_posts', 'sumobi_edd_order_category_downloads' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment