WP Query Search Filter
[resolved] Make it work with polylang (4 posts)

  1. creatile
    Posted 3 years ago #

    How can I make the plugin work with polylang ?

    I have tried to modify the query in process.php in order to get the results in the current language.

    I have tried

    $query->set( 'language', 'english' );
    $query->set( 'lang', 'en-US' );

    But it still doesn't work

    I have seen in the polylang documentation that I should modify the get_search_form function

    Do you have an idea ?

    Best regards


  2. TC.K
    Plugin Author

    Posted 3 years ago #

    I am not familiar with polylang plugin. But from the documentation i read, i think you should use the slug instead of the language Locale in the query, like this:
    $query->set( 'lang', 'en' );
    instead of
    $query->set( 'lang', 'en-US' );

    Hope this helps.

  3. creatile
    Posted 3 years ago #

    This solution is working for me

    $query->set( 'lang', 'en' );

    Thanks a lot

  4. snap-shot
    Posted 3 years ago #

    Do you know how to manage it with WPML?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic


No tags yet.