Last active
January 3, 2016 13:19
-
-
Save amdrew/8468347 to your computer and use it in GitHub Desktop.
Order downloads alphabetically on category pages in Easy Digital Downloads
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 | |
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