Skip Navigation

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

Problem:
The client is experiencing an issue where the German flag on their WordPress site appears smaller than other flags despite setting all flags to a uniform size of 30x30 in WPML > Languages. The issue persists even after adding custom code to prevent resizing. The problem seems to be related to the Blocksy theme, as changing to a different theme resulted in consistent flag sizes.
Solution:
We recommend checking the original size of the uploaded flag images, as the German flag might be smaller in its original dimensions. If the flags are not uniform in size, consider uploading new images that match the desired dimensions. Additionally, since the issue is theme-specific, contacting the theme's support for insights or considering a theme change might be necessary if consistent flag sizes are crucial. For now, setting all flags to 'auto' ensures they appear consistent across different pages, albeit smaller.

If this solution does not resolve your issue or seems outdated, please check related known issues at https://wpml.org/known-issues/, verify the version of the permanent fix, and confirm that you have installed the latest versions of themes and plugins. If further assistance is needed, we highly recommend opening a new support ticket here.

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

Last updated by Itamar 7 months, 4 weeks ago.

Assisted by: Itamar.

Author Posts
June 5, 2024 at 6:31 am #15704942

lynetteO-2

Background of the issue:
I am trying to ensure that the flags on my WordPress site, hidden link, are all the same size. I have set the size of the flags to 30 x 30 and added some code in the wp.config file to prevent the flags from changing size.

Symptoms:
On the desktop, the German flag is smaller than all the other flags.

Questions:
Why is the German flag smaller than the other flags despite setting the size to 30 x 30?
Is there a specific code or setting in WPML that can ensure all flags remain the same size?

June 5, 2024 at 6:50 am #15705177

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi,

This ticket has been inactive for quite a while. I didn't get a reply from you. So, I've transformed this chat into a support ticket because you may still need our help. If you do, please reply to this ticket, and one of our supporters will continue helping you.

I assume you mean that the German flag is smaller when German is the selected language. Because other than that, the German flag in the Language Switcher is the same size as the other flags.

This is the custom code you created, and we can only advise because supporting custom code is out of the scope of our support forum.

I can see that the German flag's original size (when the German language is selected) is only 20.33px X 13.55px. Please see the attached screenshot. The other flags are 30px X 20px.

I hope this will help you solve this problem. If not, please share the CSS you added with us.

You wrote: " I have set the size of the flags to 30 x 30 and added some code in the wp.config file to prevent the flags from changing size."

I'm confused because I don't understand how the wp-config.php file is related to CSS issues.
Can you please explain?

Regards,
Itamar.

2024-06-05_09-41-13.jpg
June 5, 2024 at 9:57 am #15706054

lynetteO-2

Hi there,

Thank you for transforming it into a support ticket.

I would like to have that all flags are the same size. In WPML > languages I put 30 x 30 for all flags, so they are a little big bigger than the original images (see screenshot, language is in Dutch sorry, but it displays 30x30).

I read online that some people also had problems with the flag sizes and that WPML support advised to add additional CSS code to prevent the flags from resizing (define('WPML_DO_NOT_RESIZE_UPLOADED_FLAGS', true), but I will remove that code.

So you are saying that the uploaded flag image of the German flag is smaller than the other flags, but I did not upload any of these images, that goes automatically by WPML? Or how can I solve this? Can I upload new images somehow? Can I reset the flag images?

Thank you in advance.

Kind regards,
Lynette

Scherm­afbeelding 2024-06-05 om 11.50.48.png
June 5, 2024 at 2:17 pm #15707401

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi,

This is a weird case. I was unable to replicate it on my test site. Please see the attached screenshot.

If you need further help with this, please share the access details to your site with me.
I'm enabling a private message for the following reply.

Privacy and Security Policy
We have strict policies regarding privacy and access to your information. Please see:
https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/
**IMPORTANT**
- - Please backup the site files and database before providing us access. --
-- If you have a staging site where the problem can be reproduced, it is better to share access to the staging site.--

Regards,
Itamar.

2024-06-05_17-16-27.jpg
June 9, 2024 at 8:57 am #15719107

lynetteO-2

Hi Itamar,

I have send you a private message.
Can you still help with the issue?

Many thanks in advance.

Kind regards,
Lynette

June 9, 2024 at 2:01 pm #15719455

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi, Lynette.

Thanks for the access details.

You wrote: "I still do not know how you solved the issue on your test website."

Well, I didn't solve it on my test site. The problem never occurred on my test site.

I removed the following CSS code from the "Additional CSS" section in WPML -> Languages -> Language Switcher Options to investigate this issue.

nav ul[class*="menu"] li.wpml-ls-menu-item ul.sub-menu,
nav ul[class*="menu"] li.wpml-ls-menu-item ul.sub-menu li a {
  width: auto;
  min-width: 30px;
}

The problem also occurs without this CSS code. So, I don't think it affects the Language Switcher.

I've noticed that the problem occurs randomly and with the other flags. Please see my video here.

hidden link

Do you have a staging site where this problem also occurs?

If so, please try the following.

I suspect that there is a collision with the theme or another plugin that might cause this problem. If possible, get your site into a minimum environment, Which means switching to a default WordPress theme like TwentyTwenty-One and having no plugins activated except WPML.

First, you must check if the problem persists when just the theme is switched to TwentyTwenty-One (for example). If it persists, deactivate all plugins except the WPML and its add-ons. Then please check if the problem persists. If it does not persist, start by activating the plugins individually, check when the problem comes back, and then report which plugin was the culprit.

**** Important! Please make a full site backup (files and DB) before you proceed with those steps****


*** If your site is live, you might want to try those procedures in a staging environment or a snapshot of your site on your local server or another server. ***

Regards,
Itamar.

June 16, 2024 at 2:01 pm #15742550

lynetteO-2

Hi,

Thank you for your message.

I deleted all plugins and that did not help.

I installed a different theme and with another theme the flag sizes were consistent. So it is somehow caused by the Blocksy theme.
I also removed the Blocksy theme and re-installed it, but that did not help. I send a message to Blocksy if they know what is the cause.
For now, I have just set all flags to auto, so they have a small size at each page and are consistent throughout the different language pages.

To conclude, still do not know why I currently can not increase the flag size with this theme. I will just keep the flag sizes on auto for the time being.

Kind regards,
Lynette

June 16, 2024 at 5:32 pm #15742821

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Thanks for the update, Lynette!

Please let us know if you need further help with this issue.

Regards,
Itamar.