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 2 replies, has 2 voices.

Last updated by enzaD 2 years, 8 months ago.

Author Posts
September 12, 2022 at 9:17 pm #12037765

enzaD

I see hooks and other options for generating a language switcher which you customize in the settings for the language. However I need to create a language switcher which is way more custom than those options allow.

I cannot find anything in the PHP API for getting the current url in another language. This should be able to work for pages, posts, archives, etc. With that function, I can probably generate the custom switcher I need to impliment.

September 13, 2022 at 7:45 am #12040199

Marcel
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: Europe/Madrid (GMT+02:00)

Hi,

before your ticket is assigned to one of my colleagues, please allow me to walk you through some initial debugging steps. This will help speed up the support process.

Please check out "wpml_current_language" as described here:
https://wpml.org/wpml-hook/wpml_current_language/.
https://wpml.org/de/faq/how-to-get-current-language-with-wpml/

And "wpml_active_languages":
https://wpml.org/wpml-hook/wpml_active_languages/

Best Regards
Marcel