Created
January 16, 2015 05:59
-
-
Save raewrites/309a3da6b3427387bc1e to your computer and use it in GitHub Desktop.
Display Alphabetical Order
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 my_function() { | |
if ( is_category() && $query->is_main_query() ) { | |
$query->set( 'orderby', 'title'); | |
$query->set( 'order', 'ASC' ); | |
return $query; | |
} | |
} | |
add_action( 'pre_get_posts', 'my_function'); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment