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'));