Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
How to reduce the width of the WPML Language Switcher dropdown.

Solution:
The language switcher dropdown was taking the width from the Elementor CSS that has set the width as 280px. You may change the width to 60px by following this doc: https://wpml.org/documentation/getting-started-guide/language-setup/language-switcher-options/how-to-fix-styling-and-css-issues-for-the-language-switchers/

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

Last updated by gabrield-17 1 year, 10 months ago.

Assisted by: Noman.

Author Posts
June 14, 2023 at 2:33 pm #13826361

gabrield-17

Tell us what you are trying to do?
I am trying to configure the language switcher in the main menu to display the flags only in a drop down. The drop down works, but the popup switcher is too wide (I suppose space normally used for language name).

Is there any documentation that you are following?
Yes, I followed the instructions on how to configure the language switcher in the menu bar, and I have used the appropriate settings.

Is there a similar example that we can see?
no.

What is the link to your site?
hidden link

Screenshot 2023-06-14 at 16.32.45.png
June 14, 2023 at 3:23 pm #13826723

Noman
WPML Supporter since 06/2016

Languages: English (English )

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

Hi,

Thank you for contacting WPML Support. Usually, the language switcher dropdown takes formatting from the current theme, I have tried to visit your site but it seems the Maintenance mode is On so I can’t see the cause of this issue on your site.

You may use the small CSS to adjust the width of the language switcher by following this doc:
https://wpml.org/documentation/getting-started-guide/language-setup/language-switcher-options/how-to-fix-styling-and-css-issues-for-the-language-switchers/

If still the issue persists, please disable the maintenance mode for a while and let me know so that I can check which CSS is causing this issue and how to override it.

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

Thank you

June 14, 2023 at 4:09 pm #13826957

gabrield-17

Hi,

I added the custom CSS to the language switcher, but still no result. Any other suggestions?

Thanks!

June 14, 2023 at 5:21 pm #13827291

Noman
WPML Supporter since 06/2016

Languages: English (English )

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

Thanks for trying the custom CSS. Could you please disable the coming soon mode for a while so that I can examine the source code of the language switcher and help you in the right direction?

Or please provide temporary access (WP-Admin and FTP Login info) to your site (preferably staging site), so that I can look into your setup and debug the issue.

Your next answer will be private which means only you and I have access to it.

=== Please backup your database and website ===

✙ I would additionally need your permission to deactivate and reactivate Plugins and the Theme and to change configurations on the site. This is also a reason the backup is really important.

Thank you

coming soon mode.png
June 15, 2023 at 6:29 am #13829241

Noman
WPML Supporter since 06/2016

Languages: English (English )

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

Thanks for providing the login details. I have noticed that the language switcher dropdown was taking width from the Elementor CSS that has set the width as 280px. I changed it to 60px and added the small CSS code in WPML >> Languages > Additional CSS section:

.wpml-ls-item ul.the7-e-sub-nav.horizontal-sub-nav {
    width: 60px! important;
    min-width: auto !important;
}

And now it looks as in the attached screenshot. Could you please check and confirm?

Please understand that I'm helping you here with an issue that is out of the scope of our support forum and we will not be able to support this particular fix in the future. Because the theme or our code might have changed, so please always be aware of this. Right now it's working without any issue.

Thank you

language switcher dropdown width.png
width.png