Tagged: ajax search, enfold, polylang
-
AuthorPosts
-
March 22, 2016 at 11:29 am #601815
Hi, I use Polylang in enfold and I have a little problem in Ajax search,.
for example, when I typing some Word I see results:
——–
Products
-Product1
-Product2
Portfolio Ítems
-Portfolio 1
-Portfolio 2
View all results
———–The problem is in (View all results link), for main language I don’t have any problem, (/?s=xxx), but for other languages don’t apply the language link (/es/?s=xxx)
Thanks in advance
March 23, 2016 at 5:48 am #602306Hey Gabri,
Could you provide us with a link to the site in question so that we can take a closer look please?
Regards,
RikardMarch 23, 2016 at 10:20 am #602417Hi, I answer below…
March 26, 2016 at 6:21 am #603774Hi!
Thank you for the info. You can try the solution provided here: https://kriesi.at/support/topic/all-languages-in-search-result/#post-363361
For further support regarding the plugin, please contact the polylang team.
Regards,
IsmaelMarch 28, 2016 at 5:13 pm #603926Hi Ismael, thanks for your answer.
Before open this topic I take a few minutes to find an answer in forums/documentation, I find the answer you comment in enfold documentation referring to this post (http://kriesi.at/documentation/enfold/polylang-ajax-search-filter/) and it solved a part of the problem, the function is to filtering results in current language and it works properly.
My problem, or problem with all people who use polylang is that (View all results link) don’t work properly, do a test in my website. (links in private)
I found 2 options to solve this:1) Hidden “view all results link” with css. I’m not happy with this option
2) Editing “functions-enfold.php” line:137
According to polylang documentation, the code to refer a “home_url()” in current language is “pll_home_url()”.
For now I edit functions-enfold.php:137
//’all_results_link’ => home_url(‘?’ . http_build_query($_REQUEST)),
‘all_results_link’ => pll_home_url().’?’.http_build_query($_REQUEST),
And now, (View all results link) works fine! I don’t know if there are another solution to fix it.
The strangest thing is that the magnifying glass always it works with current language, and really do the same result that (View all results). I don’t know why enfold team generate a different link for (view all results) and not the same..?
Please, can anyone help me to create a function to fix the problem with (View all results) link and not have to update every time the file functions-enfold.php:137..?Thanks in advance
March 28, 2016 at 9:37 pm #604072Hey!
it would require a huge amount of time and customization of the theme and that is why you would need to hire a freelance developer for this job.
We recommend to use WPML instead, as it is fully compatible with Enfold.
Best regards,
AndyMarch 28, 2016 at 10:33 pm #604125Hey Andy, the problem is not the time, I search now how to add_filter in wordpress, I read (https://developer.wordpress.org/reference/functions/add_filter/) and create a new function to include and solve the problem:
function avf_modify_ajax_search_messages($search_messages) { $search_messages[all_results_link] = pll_home_url().'?'.http_build_query($_REQUEST); return $search_messages; } add_filter('avf_ajax_search_messages', 'avf_modify_ajax_search_messages', 10, 1);
Please, check the code and include the code in ((http://kriesi.at/documentation/enfold/polylang-ajax-search-filter/)) to help others.
Thanks.
March 29, 2016 at 6:21 am #604263 -
AuthorPosts
- You must be logged in to reply to this topic.