Language missing from URL in very specific case

[ad_1]

Edit: Okay, found the reason just after writing this post. The reason was Translatepress which is also running for some things POlylang doesn’t reach. In TP German is set as main language, and when I tell it to use the main language in the URL as well, then for German visitors the Resources now have the /de/ in the URL as well. 🙂

—- original posting starts here —-

Hi there. Maybe someone can help me here, because I’m at the end of my ideas…

As written in the topic a page I am working on is missing the language in the URL in a particular case, let me explain:
Hi there. Maybe someone can help me here, because I’m at the end of my ideas…

As written in the topic a page I am working on is missing the language in the URL in a particular case, let me explain:

  • The page is in three languages: /de/, /en/ and /fr/
  • The page has several custom content types
  • the content type “resource” has a little “special” setup:
    It contains resources in all languages, but visitors are supposed to see ALL resources in their searches, not only the ones in the language they’re seeing the page in.

    I found that this can be achieved by excluding the resources from Polylang translation, so they’re basically “without” language. This way each user can always see all resources. (They have their actual language in a custom taxonomy, so users can filter for resources in the language of their choice).

    So far so good – now for the issue:

  • Somewhere along the way we noticed that even though they have no language in Polylang and the “normal” URL of them is …/resource/title they also can be called by …/en/resource/title or …/fr/resource/title. Actually “get_post_permalink();” returns the URLs like this.

    Except for German /de/ – when the visitor has /de/ as his language for the page, then the URLs returned are “…/resource/title” – and when I enter “…/de/source/title” I’ll get a 404.

Thing is – customer would like the /de/ – URLs to work for the resources as well.

At this point I have no more idea where I could search for the reason this happens like that…

Does anyone maybe have an idea?

  • This topic was modified 13 minutes ago by kruge.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer