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

Last updated by Diego Pereira 12 months ago.

Assigned support staff: Diego Pereira.

Author Posts
October 18, 2018 at 12:53 pm #2827987

cerizaZ

I'm using Salient theme.
Tell us what you are trying to do?
I'm trying to add the language switcher in the header menu, on the right side, next to the search button.
The support from Salient sent me here.

October 19, 2018 at 7:30 pm #2832887

Diego Pereira
Supporter

Languages: English (English ) Spanish (Español ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello @cerizaz, welcome to the WPML support Forum!

Here is our options to add a Language Switcher: https://wpml.org/documentation/getting-started-guide/language-setup/language-switcher-options/

Do you have a widget or shortcode area next to the search menu? If so, you can add this shortcode:

[wpml_language_selector_widget]

Or assign a widget to that area.

Please let me know if it worked for you.

All the best,
Diego

October 23, 2018 at 6:24 am #2841050

cerizaZ

That area in the menu bar doesn't have widgets.

October 23, 2018 at 1:26 pm #2842618

Diego Pereira
Supporter

Languages: English (English ) Spanish (Español ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hi there,

In this case you will need to modify the theme directly in the code. You can use the following snippet to add a language switcher to your code:

<?php do_action('wpml_add_language_selector'); ?>

You need to find the area of the code where you want to include the language switcher, and then add the code snippet above.

Ref: https://wpml.org/documentation/getting-started-guide/language-setup/language-switcher-options/

We recommend that you use a child-theme to do this, so you do not need to modify the original theme code: https://codex.wordpress.org/Child_Themes

If you need some help, we have a list of experienced contractors available here: https://wpml.org/contractors/

Kind Regards,
Diego