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

Last updated by Hassan Saggaf 1 week, 2 days ago.

Assigned support staff: Noman.

Author Posts
October 3, 2019 at 3:55 pm #4689617

Hassan Saggaf

Hello;

I m trying to add Language Switcher on my TOP BAR, i have tried to used this code in header php; <?php do_action('wpml_add_language_selector'); ?> but no luck... I even cant use this code in my theme setting TOP BAR as it supports only SHORTCODE but not php...

So Is there any Short Code? i m trying to just display language if its English page will show ARABIC VERSION button, if im in Arabic Page, it will show ENGLISH VERSION button..

Awaiting Thanks.

October 3, 2019 at 5:18 pm #4690041

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting WPML Support.

1. Yes, you can add language switcher using below shortcode:

[wpml_language_selector_widget]

And this shortcode outputs the language switcher based on the options set in the Custom Language Switchers section:
https://wpml.org/documentation/getting-started-guide/language-setup/language-switcher-options/#using-wpml-shortcodes

2. Then uncheck the ‘Current language’ checkbox this will show only opposite language as you can see in the attached screenshot.

Please let me know if you need further assistance to resolving this issue.

Thank you

October 3, 2019 at 8:42 pm #4691369

Hassan Saggaf

Hello and thanks for reply.

I have done what you have instructed, MENU LANGUAGE SWITCHER > this setting; hidden link but unfortunately its showing the both languages this one; hidden link....

i want when i m in English Page, it shows ONLY ARABIC BUTTON .... and if im in Arabic page, it shows ONLY ENGLISH BUTTON... How to?

Awaiting Thanks...

October 4, 2019 at 7:14 pm #4698327

Hassan Saggaf

Hello;

Any update pls?

October 5, 2019 at 11:16 am #4700297

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Sorry for delay, I am off Fridays and Saturdays (my weekend). I will check it tomorrow, if you need urgent help please feel free to open a new chat with our available team members.

Thanks

October 6, 2019 at 6:48 am #4701739

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

If you are showing language switcher using this shortcode:

[wpml_language_selector_widget]

Then this shortcode outputs the language switcher based on the options set in the WPML >> Languages > Custom Language Switchers section and not MENU LANGUAGE SWITCHER section.

Please let me know if this resolves your issue or you need further assistance with this issue.

Thank you

October 6, 2019 at 5:52 pm #4703075

Hassan Saggaf

Great!!!...

My issue is resolved now. Thank you!