add filters search
This commit is contained in:
@@ -173,8 +173,10 @@ add_filter( 'single_template', function ( $single_template ) {
|
||||
#search
|
||||
function my_search_order( $query ) {
|
||||
if ($query->is_search) {
|
||||
$query->set( 'order', 'DESC' );
|
||||
$query->set( 'orderby', 'date' );
|
||||
if (!isset($_GET['search_type']) OR $_GET['search_type'] == 'date'){
|
||||
$query->set( 'order', 'DESC' );
|
||||
$query->set( 'orderby', 'date' );
|
||||
}
|
||||
};
|
||||
return $query;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user