WordPress.org

Ready to get started?Download WordPress

Forums

Polylang
[resolved] Serch rezults only in default langauge (11 posts)

  1. Baz11
    Member
    Posted 1 year ago #

    When I use search in default language - it works great. When I try to use search in other language it returns search-result page in default language, which contains "nothing found", but if to use language switcher and switch this page in default language with "nothing found" to language of search -it returns right results.

    http://wordpress.org/extend/plugins/polylang/

  2. Chouby
    Member
    Plugin Author

    Posted 1 year ago #

    What is your theme? What is your permalinks setting?

  3. Baz11
    Member
    Posted 1 year ago #

    Theme: Graphene
    Permalinks setting: /%postname%.html

  4. Chouby
    Member
    Plugin Author

    Posted 1 year ago #

    I don't reproduce the issue. Have you a link?

  5. becleung
    Member
    Posted 1 year ago #

    I just ran into the same problem. Here's the site I'm working on.

    http://wfwp.org.hk/

    It looks like the problem is that there's no slash after the language permalink:

    http://wfwp.org.hk/zh?s=參與

    If I manually type in a slash like this:
    http://wfwp.org.hk/zh/?s=參與

    The search works great.

    Now the problem is, I can't figure out why that slash is missing and how to make the search function add that slash.

  6. Chouby
    Member
    Plugin Author

    Posted 1 year ago #

    @becleung

    You are right. There should be a slash and there is one on my test site. Could you try this modification: edit the file polylang/core.php at line 820 and replace:

    return $this->home_urls[$language->slug][$is_search] = get_term_link($language, 'language');

    by:

    return $this->home_urls[$language->slug][$is_search] = trailingslashit(get_term_link($language, 'language'));
  7. Baz11
    Member
    Posted 1 year ago #

    Yes. When try simple search: site.com/en?s=word - it don't work.
    When manualy add "/" - site.com/en/?s=word - works.

    Sorry :)
    I didn't see post above/ I will try

  8. Chouby
    Member
    Plugin Author

    Posted 1 year ago #

    Alternatively, you can download the development version (0.9.4.9) in which I included the proposed correction.
    http://downloads.wordpress.org/plugin/polylang.zip

  9. becleung
    Member
    Posted 1 year ago #

    Changed line 820 in polylang/include/core.php

    It works now, thank you!

  10. Chouby
    Member
    Plugin Author

    Posted 1 year ago #

    OK. Consider that the modification will be included in the next release.

  11. Baz11
    Member
    Posted 1 year ago #

    Now search is working correctly!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.