Hello!
I’m having some trouble editing the search query. I’m using the plugin alongside Relevanssi and want results to be sorted by relevance as well as post_date or modified date. I tried adding this to the functions file
function filter_function_name( $query_args, $sfid ) {
//if search form ID = 225, the do something with this query
if($sfid==5671)
{
//modify $query_args here before returning it
$query_args['orderby'] = 'post_date';
}
return $query_args;
}
add_filter( 'sf_edit_query_args', 'filter_function_name', 20, 2 );
But it doesn’t amend the search URL or results.
Any help would be greatly appreciated!