This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
|July 7, 2019 at 2:49 pm #4157827|
Tell us what you are trying to do?
What I'd like to do now, is to tell WPML the target urls for all languages included in the language switcher (and I'm hoping, WPML will also pass these urls to the hreflang headers). So for example I've configured en, de, fr and I'd like to tell WPML for en, please use x, for de, please use y and for fr, please use z.
At the moment, the language switcher is falling back to the home url, as long as I'm on one of the custom pages.
Is there any documentation that you are following?
What is the link to your site?
|July 8, 2019 at 11:07 am #4161679|
Languages: English (English )
Timezone: Asia/Kolkata (GMT+05:30)
As far as I understand, you are trying to replace the language codes with a dummy text which means you are replacing the language code with a nonexisting language configured in your site and hence the language switcher redirects the request to the home URL based on the settings in WPML > languages > Language Switcher.
Since you have a mapped a dummy language code to an existing code the request needs to parsed again to the active language of the site after the language switcher action is triggered.
The best I can suggest is to use a custom language switcher which will enable you to manipulate the request to a certain extent
Unfortunately, this falls out of the scope of our support but you can check out our Certified Contractors list as they will be prepared to help you with any custom coding you need related to WPML. The list can be found here: https://wpml.org/contractors/