[resolved] Problem with determining the language of a post (2 posts)

  1. Orcsik Antal
    Posted 2 years ago #

    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:

    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!


  2. Orcsik Antal
    Posted 1 year ago #

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

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic