Created
October 9, 2015 07:01
-
-
Save SeanChDavis/fced2f492c103bc7a347 to your computer and use it in GitHub Desktop.
EDD Order Download Archive by ASC Title
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 // 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