Created
July 26, 2018 10:43
-
-
Save FSahinn/44d9f41194d9746b6710d0e1bf6f15fa to your computer and use it in GitHub Desktop.
Kategoriyi başlığa göre sıralama
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
// Kod ?>'ın hemen üstüne eklenecek. | |
function foo_modify_query_order( $query ) { | |
if ( $query->is_category() && $query->is_main_query() ) { | |
$query->set( 'orderby', 'title' ); | |
$query->set( 'order', 'ASC' ); | |
} | |
} | |
add_action( 'pre_get_posts', 'foo_modify_query_order' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment