• I did a custom form with searchform.php in order to make more complex searches. Using pll_home_url() has been easy.

    However, with anything more complex, e.g. a combination of searching text + categories, the search queries don’t work.

    Default language: EN.
    Secondary language: FR.

    Example 1:
    This URL does work:
    [home_url]/category/dogs/?post_format=post-format-aside&s=
    However, by using the language switcher it becomes this:
    [home_url]/fr/category/chiens/?post_format=post-format-aside&s=
    which redirects me to English.
    Trying without the “fr”:
    [home_url]/category/chiens/?post_format=post-format-aside&s=
    didn’t work either: it still redirects me to English.

    Example 2:
    This URL does work:
    [home_url]/category/dogs/?s=
    But this redirects to English (expected the French page about dogs):
    [home_url]/category/chiens/?s=

    Example 3, working in the default language only (English):
    [home_url]/category/dogs+cats
    Redirects me to dogs only even though there are posts with both the dogs and cats categories.

    Permalinks settings
    “Post name” [home_url]/sample-post/
    “Optional” section untouched

    Using a static front page

    Polylang settings
    URL modifications:
    “The language is set from content”
    “Hide URL language information for default language: checked”
    “Remove /language/ in pretty permalinks”
    “The front page URL contains the language code instead of the page name or page id”
    Everything synchronized.

    What I’ve tried
    Tons of different URLs; nothing works.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Search queries don’t work and redirects to default language’ is closed to new replies.