Skip to content Skip to sidebar

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

Problem:
If you're experiencing issues with the alignment and spacing of language flags in the WPML language switcher, particularly when your website is in RTL or LTR mode, the problem might be due to CSS conflicts or custom code affecting the display.
Solution:
First, check if there is any custom CSS or code from your theme or plugins that might be overriding WPML's default styles. Specifically, issues can arise from the theme or other plugins like greenshift blocks that add custom styles to elements used by WPML. If you find such CSS, you can either remove it or add the following CSS code to your theme to correct the spacing issue:

body .wpml-language-switcher-block ul.hasSpacing.isHorizontal li:not(:last-child) {<br />    margin-right: 0 !important;<br />    margin-top: 0 !important;<br />}

Alternatively, if the issue is caused by specific plugin CSS, you might need to override it with:

.wpml-language-switcher-block ul.hasSpacing.isHorizontal li:not(:last-child) {<br />    margin-right: var(--language-spacing) !important;<br />}

If these solutions do not resolve the issue or if the problem persists, it might be due to other underlying factors. We recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins.

If the problem still exists, please open a new support ticket with us for further assistance at WPML support forum.

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

Last updated by Christopher Amirian 1 month ago.

Assisted by: Christopher Amirian.

Author Posts
May 3, 2026 at 7:15 am #18009085

phaP

hi ... I think there is a small issue, when website is in RTL mode, or maybe in LTR too. as you see the attached screenshot, the flags can not be aligned with same space to each other. also when I select just 2 language, they also do not align and not in exact one line. this issue is small, but its a bit ugly so would you correct it in next update.
thx in advance

May 3, 2026 at 1:22 pm #18009395

Christopher Amirian
WPML Supporter since 07/2020

Languages: English (English )

Timezone: Asia/Yerevan (GMT+04:00)

Hello and welcome to WPML support. Such issues happen when there are two scenarios:

1. The CSS that WPML generates is forced to be overwritten by the CSS of the theme or custom CSS

2. There is a custom code changing the way WPML shows the language switcher.

From the screenshot you shared, it shows that there is custom CSS you used that caused the issue, as WPML does not have that round flag feature at all.

But I will be happy to check. Unfortunately, I do not have the link to the age at which you took the screenshot.

Please give me the link so I can check the code in the front end via my browser and see if I can help.

Thanks.

May 7, 2026 at 10:42 am #18020007

phaP

please check below link. the screenshot is is from the footer ;
hidden link

beside, the theme I use is BLOCKSY which is in full compatibility as mentioned in wpm website. I have not add any CSS unless maybe Blocksy has by itself. the screenshot is language switcher block which I think is from wpm, or maybe I am wrong.

wait for you advise

May 7, 2026 at 11:32 am #18020165

Christopher Amirian
WPML Supporter since 07/2020

Languages: English (English )

Timezone: Asia/Yerevan (GMT+04:00)

Hi,

Thank you for the link. Please add the CSS code below to your theme and it should fix the spacing:

body .wpml-language-switcher-block ul.hasSpacing.isHorizontal li:not(:last-child) {
    margin-right: 0 !important;
    margin-top: 0 !important;
}

Thanks.

May 11, 2026 at 12:06 am #18025558

phaP

ok thx . but would you. tell me what causes the issue ? is it from WPML side or its from theme which is blocksy. I mean how can I follow up as this is not only site that have this issue and I should add this css code on other clients website too. so I thought if u tell me the problem route then I can follow up, if I can do anything from my side.

thx in advance

May 11, 2026 at 11:51 am #18027211

Christopher Amirian
WPML Supporter since 07/2020

Languages: English (English )

Timezone: Asia/Yerevan (GMT+04:00)

Hi,

Thank you for your reply. The code that causes the issue is generated by the greenshift blocks plugin.

But I think there is a custom CSS inside the block that causes the issue, but I can not be sure.

The solution would be to either find and remove the CSS code:

.wpml-language-switcher-block ul.hasSpacing.isHorizontal li:not(:last-child) {
    margin-right: var(--language-spacing) !important;
}

Or use the code that I gave you to override the code above and fix the issue.

Thanks.