• Hello,

    I have a domain exampletestdomain.cz whose primary language is Czech.
    The other two domains exampletestdomain.pl and exampletestdomain.eu are Polish and English site mutations.

    I managed the first configuration (same directory for all translations), but I am solving the problem that WordPress generates links based on exampletestdomain.cz, even though they go to other language mutations.

    The PL version of the page/article/custom post is then with a link
    exampletestdomain.cz/polish-page

    instead of the correct one

    exampletestdomain.pl/polish-page (if I enter this URL manually, it works)

    It’s the same with English version.

    A situation often arises when I have content in one of the translation languages, but the rest of the page (menu, footer, etc.) is in the primary language (CZ).

    I’ve tried possible and impossible solutions (2 days of searching and testing), but I’m not able to find any workable and more sophisticated solution than manually writing the complete URL to the language mutation.

    get_post_permalink() simply returns the .cz domain even in cases where it should call .pl or .en.

    I will be glad for your help.

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

    (@mypixels)

    I have a working solution for my case.

    This needs to be inserted in wp-config.php
    define(‘WP_SITEURL’, ‘https://’ . $_SERVER[‘HTTP_HOST’]);
    define(‘WP_HOME’, ‘https://’ . $_SERVER[‘HTTP_HOST’]);

    The domain with the translation then “holds” the correct URLs and the languages ??are not mixed together with the primary domain and language.

    *If used as above, the language switcher stops working (all URLs go to the currently selected language mutation) – I’m not currently dealing with it because I end up using it statically and not generated via Polylang.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.