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 Noman 5 months ago.

Assigned support staff: Noman.

Author Posts
May 9, 2019 at 2:48 am #3772323

joeyW-3

Tell us what you are trying to do?
I'm trying to put the menu language switcher in my top bar, I can only see widget and footer shortcode in the document, but not the menu one, is there any shortcode for menu language switcher?

Is there any documentation that you are following?
https://wpml.org/documentation/support/wpml-coding-api/shortcodes/

Is there a similar example that we can see?
WPML site top bar looks good!

What is the link to your site?
hidden link

I put what I want in the screentshot

Thanks!

May 9, 2019 at 5:50 am #3773215

Noman
Supporter

Languages: English (English )

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

Hi,

Thank you for contacting WPML support.

The possibility to add your language switcher on that position depends on your theme. Does your theme provides you the option to add a content (for example a widget) or some code exactly on the position that you wish?

You can use below code to show custom language switcher on specific position:

do_action('wpml_add_language_selector');

Here is doc for custom language switcher:
https://wpml.org/documentation/getting-started-guide/language-setup/language-switcher-options/#custom-locations

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

Thank you

May 9, 2019 at 6:06 am #3773225

joeyW-3

Hi there,

Thanks for the reply, I have done this by using this [wpml_language_selector_footer], but I want to only show flags and let the two flags stay in one line, or only show one flag and have the dropdown menu just like official WPML site?

Thanks!

May 9, 2019 at 6:36 am #3773299

Noman
Supporter

Languages: English (English )

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

Hi,

To display only flags, you can customize Footer language switcher by pressing the pencil icon from WPML >> Languages > Footer language switcher and select similar options as in the attached screenshot.

Thank you

May 9, 2019 at 7:18 am #3773593

joeyW-3

sorry man, I followed your instruction, the list is still vertical, is there a way to make it to dropdown menu? maybe not using footer? Is there a menu language switcher shortcode ? I like that one.

May 10, 2019 at 12:51 am #3780013

joeyW-3

Hi there,

I can see that in my site the class "wpml-ls-legacy-list-horizontal" is not taking place, should I add and css to my site?

Thanks
Joey

May 12, 2019 at 6:36 am #3792437

Noman
Supporter

Languages: English (English )

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

Hi,

Sorry for delay, my off days are Friday and Saturday and now I am available and reply time will be shorter from now.

If you want to display language switcher as dropdown then please use this 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

Yes, you can easily add CSS to language switcher, I can also provide you CSS if you need to.

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

Thank you

The topic ‘[Closed] short code placement’ is closed to new replies.