Created
March 5, 2013 17:57
-
-
Save sewmyheadon/5092464 to your computer and use it in GitHub Desktop.
Modify WordPress query order - alphabetical
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 smho_modify_query_order ( $query ) { | |
if ( $query->is_home() && $query->is_main_query() ) { | |
$query->set( 'orderby', 'title' ); | |
$query->set( 'order', 'ASC' ); | |
} | |
} | |
add_action( 'pre_get_posts', 'smho_modify_query_order' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment