Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function jh_popularity_sort_query($query) {
- if ( ! $query->is_main_query() ) {
- return $query;
- } else {
- $query->set( 'orderby', 'date' );
- }
- return $query;
- }
- add_action('pre_get_posts', 'jh_popularity_sort_query');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement