Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #355877

    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

    #356196

    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

    #356669

    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

    #357347

    Hi!

    I’ll ask Kriesi to check this thread. This might not be added on the next update because Relevanssi is not commonly used. For now, please create a change log of the modification.

    Best regards,
    Ismael

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Double ?lang=en with "view all results" problem in search’ is closed to new replies.