• Resolved Meneer_Pieter

    (@meneer_pieter)


    Hello,

    I have been working on setting up a multilingual blog for some time now but I am a beginner when it comes to WordPress etc. My blog has 4 languages, English as default.

    I have managed to change some code so the blog always displays English posts unless if there is a translation available for the selected language.

    However, when you click the link to read an English post, it automatically changes the selected language to English:

    click on post &p=67 goes to &p=67&lang=en instead of &p=67&lang=nl. I want to read the English post but the selected language should not change.

    Is this possible?
    Thanks in advance.

    https://ww.wp.xz.cn/plugins/polylang/

Viewing 5 replies - 1 through 5 (of 5 total)
  • A ‘go to fallback language if no translation is available’ is indeed a needed feature, IMO. There’s a thread on this.


    Tom

    Thread Starter Meneer_Pieter

    (@meneer_pieter)

    The posts displayed already show the default language when there is no translation. However, when reading an English article, it automatically switches the whole site to English. Even if the link would be ?p=10&lang=nl it opens &p=10&lang=en.

    I’m wondering if it is possible to change GET[“lang”] somehow.

    Thread Starter Meneer_Pieter

    (@meneer_pieter)

    Problem solved.
    While messing around with some code, I found out that it somehow works when the article URL is set to the_permalink + &olang=[current language]

    It will then forward to &p=10&olang=nl&lang=en and although lang=en is set, the rest of the website is displayed in the correct language.

    I’m not really sure why it works though..

    Hi I have same issue can you explain a little more detail how you fixed this

    Thread Starter Meneer_Pieter

    (@meneer_pieter)

    Hi,

    I added olang to the post’s URLs:

    <a href="<?php the_permalink(); echo '&olang='.pll_current_language(); ?>" rel="bookmark">

    I found out that the problem is solved just by adding this, like I said: I’m not sure why it works as I haven’t written any code to handle olang…

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Read other language without changing language’ is closed to new replies.