Created
January 3, 2015 15:09
-
-
Save mindctrl/78f215742ff307085ac9 to your computer and use it in GitHub Desktop.
Easy Digital Downloads - sort category and tag archives by title
This file contains hidden or 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
| function jp_sort_download_archives( $query ) { | |
| if ( is_tax( array( 'download_category', 'download_tag' ) ) && $query->is_main_query() ): | |
| $query->set( 'orderby', 'title' ); | |
| $query->set( 'order', 'ASC' ); | |
| endif; | |
| } | |
| add_action( 'pre_get_posts', 'jp_sort_download_archives' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment