Last active
December 16, 2015 06:19
-
-
Save Dianakc/1d611238a64afbb1b24c to your computer and use it in GitHub Desktop.
Modifica a ordem dos posts na listagem
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 sort_categories_by_title($x) { | |
if (is_category()) { //can set specific ones | |
$x->query_vars['orderby'] = 'title'; | |
$x->query_vars['order'] = 'ASC'; | |
} | |
} | |
add_action('pre_get_posts', 'sort_categories_by_title'); | |
;?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment