This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Search only in posts of current language (WPML)

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Search only in posts of current language (WPML)

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #15011
    witwebwitweb
    Participant

    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.

    http://www.defaq.nl

    Doing a search in English will lead to a Dutch page.

    Im using 2 different shortcodes, one for NL and one for EN

    #15012
    witwebwitweb
    Participant

    Using 1 shortcode now,

    Disabled caching and still not working

    #15013
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi!

    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.

    #15015
    witwebwitweb
    Participant

    Great, that fixed it.

    Is it possible to use cache or not?

    #15016
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Sure, you can use caching, this custom code should not affect it in any way. Make sure to clear the cache after the change though.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.