I use Enfold, WPML and Relevanssi. In the Relevanssi plugin options I have opted to only search in the current language.
When I use the search box, I get the correct results in only the current language. However, at the bottom of the search box there is a link with “view all results”. When I click this it goes wrong. This is because the link has double the ?lang=en in the URL. For example searching for keyword price would be: /?lang=en?lang=en&s=price and it should be /?lang=en&s=price
How to fix this?
Kind regards,
Gerson
Hi e-cat!
Please try to add this code to your child theme functions.php file or enfold/functions.php:
function avia_custom_wpml_translate_all_search_results_url($search_messages, $search_query)
{
$search_messages['all_results_link'] = home_url() . '?' . $search_messages['all_results_query'];
return $search_messages;
}
add_filter('avf_ajax_search_messages', 'avia_custom_wpml_translate_all_search_results_url', 15, 2);
Regards,
Peter
Thank, this fixes the bug! Will this fix be included in the next update, so that I don’t have to add this code again after an update? (I don’t use a child theme, and would prefer not to make one for only this change).
Kind regards,
e-cat