Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Is there a way to use search parameters as conditional values? › Reply To: Is there a way to use search parameters as conditional values?
Hello, thanks so much for the answers, you’ve been of great help.
Sorry to bother you again, but I was wondering if there’s a way to order the search results using this custom query:
[php] $query->set( ‘orderby’, array(
‘meta_value_num’=>’ASC’,
‘title’=>’ASC’
) );
$query->set(‘meta_key’, ‘contenido’);
}
#’contenido’ is a boolean custom field[/php]
I’ve tried to use it with the pre_get_posts hook combined the is_search() conditional but it doesn’t seem to work:
Thanks again for the help.
Edit: I added an image of the query because the code isn’t being displayed correctly.