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)

This topic contains 4 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 6 years, 5 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #15011
    witweb
    witweb
    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
    witweb
    witweb
    Participant

    Using 1 shortcode now,

    Disabled caching and still not working

    #15013
    Ernest Marcinko
    Ernest 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.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #15015
    witweb
    witweb
    Participant

    Great, that fixed it.

    Is it possible to use cache or not?

    #15016
    Ernest Marcinko
    Ernest 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.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.