This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: Is there a way to use search parameters as conditional values?

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?

#19512
wikotwikot
Participant

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.

  • This reply was modified 7 years, 7 months ago by wikotwikot.
  • This reply was modified 7 years, 7 months ago by wikotwikot.
  • This reply was modified 7 years, 7 months ago by wikotwikot.