Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Search only in posts of current language (WPML)
This topic contains 4 replies, has 2 voices, and was last updated by Ernest Marcinko 6 years, 6 months ago.
- AuthorPosts
- October 5, 2017 at 1:13 pm #15011
Hi,
Is it possible to make the plugin search only on the posts of the current language in WPML?
Right now it is only showing the primary results, even when page is on English.
Doing a search in English will lead to a Dutch page.
Im using 2 different shortcodes, one for NL and one for EN
October 5, 2017 at 1:21 pm #15012Using 1 shortcode now,
Disabled caching and still not working
October 5, 2017 at 1:32 pm #15013Hi!
It looks like that the problem there is with the permalinks, they are missing the ‘/en/’ part for some reason. By default the plugin searches only the currently active language. The items I see are translated, but the link is not completely correct, which is odd, because it’s requested from WPML directly.
Anyways, I beleieve this could be possible to fix with a small custom code snippet easily.
Add this custom code to the functions.php in your theme/child theme directory (copy from line 3 only!). Before editing, please make sure to have a full site back-up just in case!
If you need any help with this, just add temporary FTP details to your ticket, and I will add this code for you.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
October 5, 2017 at 2:17 pm #15015Great, that fixed it.
Is it possible to use cache or not?
October 5, 2017 at 3:08 pm #15016Sure, you can use caching, this custom code should not affect it in any way. Make sure to clear the cache after the change though.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
- AuthorPosts
You must be logged in to reply to this topic.