WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. creatile
    Member
    Posted 1 year 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

    http://wordpress.org/extend/plugins/wp-query-search-filter/

  2. TC.K
    Member
    Plugin Author

    Posted 1 year 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
    Member
    Posted 1 year ago #

    This solution is working for me

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

    Thanks a lot

  4. snap-shot
    Member
    Posted 1 year 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

Tags

No tags yet.