How to retain site language when visiting untranslated post types
-
I’m using the Polylang plugin in a website with a custom theme (developed by me). There are several custom post types, most of which are translated.
There is, however, one post type for which translation is intentionally not enabled. In my front page I show a list of links to posts of this type. Because this post type is not translated, the same links appear on the front page regardless of which language is selected.
The problem I’m facing is that, because the URLs for these posts do not include the language code, whenever I click on one of them I end up in the default language.
For example, let’s say that my site is available in English and French, and I have a post type, “article” which is not translated. From my front page in French I see a list of articles, which are not translated, all of them written in English. When I click on one of the articles, I would like to remain on the French version of the site, with the header, footer etc. being in French, even if the content of the article itself is not translated. Instead, the header and footer appear in the default language.
Any idea how to solve this?
I’m aware I can just enable translation for this post type and copy the same content for each version. However I’d like to avoid having to duplicate content like that if at all possible.
- The topic ‘How to retain site language when visiting untranslated post types’ is closed to new replies.