Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
changes for sort order
  • Loading branch information
jjc16105 committed Aug 3, 2016
1 parent bedd847 commit 13721f3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions functions.php
@@ -1,4 +1,17 @@
<?php
//
// Order search results by post_title
//
function my_search_query( $query ) {
// not an admin page and is the main query
if ( !is_admin() && $query->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');
Expand Down

0 comments on commit 13721f3

Please sign in to comment.