Skip Navigation

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.

This topic contains 1 reply, has 2 voices.

Last updated by Dražen Duvnjak 1 year, 3 months ago.

Author Posts
September 1, 2023 at 9:21 am #14325401

henryC-13

Tell us what you are trying to do?

I need 2 languages in the switcher to link to an external URL. The website has 6 languages in total, but only 4 of them are managed on the website domain, the other 2 need to link to different websites.

Is there any documentation that you are following?

I fount this article in the forum:
https://wpml.org/forums/topic/i-want-to-add-custom-link-to-the-language-switcher/
but it is not enough for my needs.

In particular I need to know:
1 - how to add more than one language
2 - how to translate the language names added via code

Moreover, using the code in the article mentioned above the flag is not showing up.

Is there a similar example that we can see?
I don't know.

What is the link to your site?
hidden link (dev website)

September 1, 2023 at 11:46 am #14326315

Dražen Duvnjak
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+01:00)

Hello,

thanks for contacting us.

The code shared on that ticket is just an example code, that you can use and adapt further to your needs. We do not provide or support custom coding, for this we advise hiring WPML contractors:

- https://wpml.org/contractors/
- https://wpml.org/purchase/support-policy/

As for how to translate language name in code, you would need to wrap it inside gettext method:

- https://wpml.org/documentation/support/enabling-text-translation-for-themes-not-compatible-with-wpml/

The flag is not working since the URL in the code is just an example URL, you need to provide the correct URL with an image.

Hope you understand and wish you a nice day.

Regards.
Drazen

The topic ‘[Closed] Adding a custom URL link on some languages in the switcher’ is closed to new replies.