• Resolved aorcsik

    (@aorcsik)


    Polylang is set on my site to find out the page language by the desired content (single, page, category, etc.) It works well for except single posts.

    I found the problem is that get_query_var('lang') always returns my default language slug (hu) on single post pages. It works well on categories, tags and the home page tho.

    There are four conditions in get_current_language() (core.php) that determine the language:

    [core.php:206]
    if ($var = get_query_var('lang')) // 1st
    ...
    elseif ((is_single() || is_page() || (is_att... // 3rd

    If I place the 3rd condition before the 1st then it works, since it finds the language from the language of the post, not the query_var, but I still don’t really understand why is the query_var always “hu” for every post, the real problem lies somewhere there.

    I know a few weeks ago it was working properly, then I updated and this was the case.

    Please help!

    https://www.ads-software.com/extend/plugins/polylang/

Viewing 1 replies (of 1 total)
  • Thread Starter aorcsik

    (@aorcsik)

    Well, it might be my mistake. I was still experiencing the problem in 1.1.1, but after saving Menu settings it works now.

Viewing 1 replies (of 1 total)
  • The topic ‘Problem with determining the language of a post’ is closed to new replies.