when using the search box i would like to show only results from the current language. at the moment it shows all. how can i limit it to the current language?
thanks
mathias
Hi MathiasVie!
Thank you for using Enfold.
Entries from other languages should be excluded by default when using the search function. Please post the website url here. We would like to check it. Make sure that you’re running Enfold 3.0.2 and the latest version of WPML.
Cheers!
Ismael
Hey!
I see. I’m sorry but we don’t provide support for third party plugins and honestly, I haven’t tried polylang yet. You can find the ajax search function on function-enfold.php file. I’ll ask Kriesi to take a look.
Regards,
Ismael
Hi!
Kriesi is a little bit busy right now so it might take a while before he can respond to this inquiry. I’ll close it for now but it will be re-opened when Kriesi respond. For faster results, please contact the plugin author or hire a freelance developer to investigate the issue further.
Regards,
Ismael
Hey!
Please try to add this code in the functions.php:
/**
* Ajax Search Query
*/
add_filter('avf_ajax_search_query', 'avf_modify_ajax_search_query', 10, 1);
function avf_modify_ajax_search_query($search_parameters)
{
$language = pll_current_language();
parse_str($search_parameters, $params);
$params['lang'] = $language;
$search_parameters = http_build_query($params);
return $search_parameters;
}
Cheers!
Ismael
Hm. Kenn das plugin leider auch nicht. würde mal bei den polylang leuten nachfragen ob es irgendeinen parameter gibt den man beim query mitschicken kann um die sprache zu filtern. Dann kan man das vielleicht in einen filter packen und mitschicken :)