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.

Tagged: 

This topic contains 4 replies, has 2 voices.

Last updated by henkt-2 1 year, 8 months ago.

Assisted by: Mihai Apetrei.

Author Posts
August 26, 2023 at 5:43 pm #14295011

henkt-2

Hello,

Currently, I'm redesigning our website. One of the things I would like to improve is a selector to choose a language.
How can I configurate something like on your site (see also attachment)?

Thanks and best regards,

Henk.

Screenshot 2023-08-26 193655.png
August 26, 2023 at 5:57 pm #14295039

Mihai Apetrei
WPML Supporter since 03/2018

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hi there.

The one from the screenshot that you attached is a dropdown-style language switcher where the language names are unchecked from the options and only the flag is left checked.

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

I hope that you will find this information helpful! 🙂

Mihai Apetrei

August 26, 2023 at 7:44 pm #14295229

henkt-2

Hi Mihai,

I added the block Language Switch to the banner container of the website. This goes allright, the language switcher is shown, but the dropdown does not work.
It makes no difference if I disable / enable “Open on click”.

The URL of the staging area is: hidden link
At the top right corner you can see the language switcher.

I’m looking forward to your reaction.
If necessary, I can give you access to the backend.

Regards, Henk

August 28, 2023 at 6:52 pm #14302801

Mihai Apetrei
WPML Supporter since 03/2018

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hi Henk.

What if instead of using the block, you are using a shortcode:
https://wpml.org/documentation/getting-started-guide/language-setup/language-switcher-options/adding-language-switchers-using-php-and-shortcodes/#language-switcher-shortcodes

If that's still not working, can you please let me know if this issue happens even when only the WPML plugins are active and you are using a default WordPress theme?

Please try the following steps so that we can test for a compatibility-related issue:

- create a full website backup
- disable all plugins except WPML and its add-ons
- check if the issue is happening again

- if it's not, reactivate your plugins one by one, checking every time if the issue shows up again so that you can understand which plugin is causing that issue

If the issue happens even with the non-WPML plugins disabled:
- leave all the non-WPML plugins deactivated

- switch to a default theme like TwentySeventeen

- try to recreate the issue now

If you have the chance, it would be best to do this in a staging (testing) environment.

Please let me know how that goes and if following any of these steps solved your issue or brought any change.

I will be waiting for your response.

Mihai

August 28, 2023 at 8:13 pm #14303185

henkt-2

Hi Mihai,

I can't use the a default theme because I'm using generatepress and it generates a banner where the WPML language switcher is included.

I have now inserted also the manual shortcode in the banner and that one seems working.
So inserting a shortcode could solve it.
You can see both language switchers in the staging area: hidden link

In the Gutenberg block I used the country code, like nl, us, etc.
How can I use that in a custom code, I didn't see it in the configuration?

And the second question: I defined width=180px; to get a minimal width, is there a more robust (non px) way to specify a minimal width?

Thanks, Henk

August 29, 2023 at 9:27 am #14305693

henkt-2

I solved with CSS.