From 0618c3e7ee7de24e07bae8b9ad9b5705e7ffa676 Mon Sep 17 00:00:00 2001 From: John Calande Date: Tue, 2 Aug 2016 15:45:55 -0400 Subject: [PATCH] fix sort ordering to order by post_title --- functions.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/functions.php b/functions.php index 98651a1..eabf779 100644 --- a/functions.php +++ b/functions.php @@ -1,5 +1,19 @@ is_main_query() ) { + if ( is_search() ) { + $query->set( 'orderby', 'post_title' ); + $query->set( 'order', 'ASC' ); + } + } +} +add_action( 'pre_get_posts', 'my_search_query' ); + function neag_scripts() { wp_enqueue_style( 'neag-style', get_stylesheet_directory_uri() . '/css/neag.css'); wp_enqueue_script('neag-custom', get_stylesheet_directory_uri().'/js/custom.js', array('jquery', 'cs'));