Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Horizontal search URL don't take correct language
This topic contains 21 replies, has 2 voices, and was last updated by smartbrand 3 years, 5 months ago.
- AuthorPosts
- June 22, 2020 at 3:05 pm #28023
Hi,
We have detected a problem.
When we show search results in horizontal view, it doesn’t catch WPML language correctly. It takes the main language, and get his URLs incorrectly. It takes the URL of the main language, and not the current language one (https://prnt.sc/t4d1o7).
We use the WPML plugin to work the languages, where the main language is Spanish and we have English and French as children.
It’s possible ti disable this results at this moment?
Can you help us to resolve this issue?
Thanks in advance,
June 22, 2020 at 3:35 pm #28026Hi,
Looks like the wpml_permalink call is not resolving the URLs correctly. I looked up their documentation, and there seems to be a way to force that. This requires a bit of custom code, but should hopefully work.
Try adding this custom code to the functions.php in your theme/child theme directory. Before editing, please make sure to have a full site back-up just in case!
add_filter('asp_results', 'asp_full_resolve_wpml', 10, 4); function asp_full_resolve_wpml( $results, $id, $is_ajax, $args ) { foreach ( $results as $k => &$r ) { if ( isset($r->post_type) ) $r->link = apply_filters( 'wpml_permalink', get_permalink($r->id), $args['_wpml_lang'], true ); } return results; }
Let me know if it works.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
June 22, 2020 at 4:00 pm #28027Hi Ernest,
We tried adding this code in our theme function.php file, but not resolve the issue.
Nothing change 🙂
We add tis code in ‘/var/www/bh.fitness/htdocs/content/plugins/ajax-search-pro/includes/views/results/horizontal.php’:
<?php if (!empty($r->post_type)) $r->link = get_post_permalink($r->id); ?>And resolve it. It’s correct?
Thanks,
June 23, 2020 at 7:11 am #28034That is very interesting. If that works, you can of course use that as a solution. I will try to integrate one for the upcoming release if possible.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
June 23, 2020 at 7:27 am #28035Hi Ernest,
Ok, thanks.
Yes you integrate if you can because is very easy and resolve this problem.
Thanks
June 23, 2020 at 11:41 am #28045Hi Ernest,
We try today and happens again. The issue issn’t resolved.
At the moment can we disable this 2 suggestions (https://prnt.sc/t4wlkq). The issue is only in this results and while you try to correct the error, we need to disable it.
What more can we try?
Thanks in advance,
June 23, 2020 at 11:47 am #28046You cannot access this content. Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
June 23, 2020 at 3:04 pm #28054Hi Ernest,
I’m creating FTP acesses, but you say us how can we disable this 2 suggestions (https://prnt.sc/t4wlkq). The issue is only in this results and while you try to correct the error, we need to disable it.
Thanks,
June 23, 2020 at 3:24 pm #28055You cannot access this content.June 24, 2020 at 1:44 pm #28074Hi,
You can exclude those results until then. I tried to connect with the details, but the server says that password authentication is denied. Can you please check?
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
June 24, 2020 at 2:43 pm #28075You cannot access this content.June 25, 2020 at 11:56 am #28081Hi Ernest,
We force to disable horizontal results.
Please, can you help us tu resolve the issue?
Thanks,
June 25, 2020 at 12:43 pm #28084Hi,
Thank you, the FTP works now. However when I tried to access the back-end I’m getting the following error: https://i.imgur.com/OwxSF6g.png
It looks like you have some sort of a DB cache active with W3TC. I very strongly recommend turning that off, that could very well cause this issue as well. I checked WPML API, everything related on how to correctly use it, but the code the plugin uses is perfectly correct. I’m afraid there might be something else causing the conflict as well.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
June 25, 2020 at 12:51 pm #28085Hi Ernest,
Can you do it directly please, and i test i. I can’t disabled
Thanks,
June 25, 2020 at 12:54 pm #28086Hi Ernest,
We desactivate W3TC plugin to try it, but not resolve this issue.
We don’t have any Cache.
Can you help us?
Thanks,
- AuthorPosts
You must be logged in to reply to this topic.