Skip to content

Instantly share code, notes, and snippets.

@SeanChDavis
Created October 9, 2015 07:01
Show Gist options
  • Save SeanChDavis/fced2f492c103bc7a347 to your computer and use it in GitHub Desktop.
Save SeanChDavis/fced2f492c103bc7a347 to your computer and use it in GitHub Desktop.
EDD Order Download Archive by ASC Title
<?php // DO NOT COPY THIS LINE
function sd_edd_order_category_downloads( $query ) {
if ( is_admin() || ! $query->is_main_query() )
return;
if( $query->is_post_type_archive( 'download' ) ) {
$query->set( 'orderby', 'title' );
$query->set( 'order', 'ASC' );
}
return;
}
add_action( 'pre_get_posts', 'sd_edd_order_category_downloads' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment