Skip Navigation

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

Problem:
You are trying to add a crisp custom flag for Spanish and English on your WPML site. You've uploaded PNGs which appear blurry, and when you add an .svg for Spanish, it appears much larger than the PNGs.
Solution:
To fix the size of the .svg custom flag to match the other flags, you can add the following custom CSS to your theme:

.wpml-ls-menu-item .wpml-ls-flag {<br />    width: 18px;<br />}

This CSS adjusts the size for all WPML flags, including custom flags, ensuring they display at a consistent size. After applying this CSS, clear your browser cache to see the changes.

If this solution does not resolve your issue or seems outdated, 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 further assistance is needed, please open a new support ticket 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 1 reply, has 0 voices.

Last updated by devinF 2 weeks, 3 days ago.

Assisted by: Noman.

Author Posts
March 5, 2025 at 12:39 am #16776283

devinF

Background of the issue:
I'm attempting to have a crisp custom flag added for Spanish and English. I noticed that the PNGs I've uploaded appear somewhat blurry in layout, but I'd like for the flags to appear sharp and crisp, similar to how they show on the WPML homepage. When I add an .svg for Spanish, it appears much, much larger than the PNGs. Link to a page where the issue can be seen: hidden link

Symptoms:
The .svg custom flag I uploaded appears way too large. The .svg flag appeared much too large.

Questions:
How can we fix the size of the .svg custom flag to match the others?

March 5, 2025 at 5:42 am #16776593

Noman
Supporter

Languages: English (English )

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

Hi,

Thank you for contacting WPML Support. I visited your site and it seems the language switcher flag shows correctly as you can see in the attached screenshot.

Could you please try to clear the browser cache and see if this resolves the issue or please let me know if I missed something?

Please let me know the results,
Thank you

flag 1.jpg
March 8, 2025 at 2:59 am #16790675

devinF

I added the following custom CSS to Divi, which resolved the issue:

/*adjusts size for all WPML flags, including custom flags*/
.wpml-ls-menu-item .wpml-ls-flag {
width: 18px;
}