Skip Navigation

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

Problem:
If you're experiencing issues where product category images are not the same height across different language versions of your site, it might be due to custom CSS not being applied to the translated template.
Solution:
We recommend checking your default language category template for any custom CSS. If found, ensure this CSS is also added to the translated templates. Alternatively, for better management and consistency, add your custom CSS in a centralized location such as Elementor > Custom code, or Appearance > Customize > Additional CSS. Here is an example of CSS that you might need to apply:

.woocommerce ul.products li.product-category a img {<br />    width: 300; /* Ensures the image fills the container width */<br />    height: auto; /* Adjusts height to maintain aspect ratio if needed */<br />    aspect-ratio: 1 / 1; /* Forces a square format */<br />    object-fit: cover; /* Crops the image without distortion */<br />}

If this solution does not apply to your case, or if it seems outdated, we highly 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 issues persist, 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.

This topic contains 2 replies, has 0 voices.

Last updated by Patrick 23 hours, 9 minutes ago.

Assisted by: Dražen.

Author Posts
March 27, 2025 at 7:13 am #16866234

Patrick

Hi Drazen

I applied the changes to my live site and it worked 🙂 Thank you for that.

I mentionned at the beginning of our mail exchange that some changes in the product category pages are not synchronized and asked if this issue was related

Product categories images should have the same height. They have in English (site language) but not in the transalated pages although the templates and pages are translated.
you can see it here:
hidden link
hidden link

Best regards
Patrck

March 27, 2025 at 7:22 am #16866366

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello Patrick,

I would need to further check to see what is wrong.

Please share the access details of your staging website, so I can log in and take a look.

Also please share what template you are using and how can I edit it.

Thanks,
Drazen

March 27, 2025 at 8:45 am #16866883

Patrick

HI Drazen

Thanks in advance for your help

Your username is [] and your password: []

new staging site.

Kind regards
Patrick

March 27, 2025 at 11:19 am #16867933

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

please add it to safe fields in the next private reply, and share with me login URL, as it seems I can not access the wp-admin page.

Regards,
Drazen

March 27, 2025 at 11:29 am #16868066

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

thanks, but as said I can not access wp-admin, it redirects to homepage.

<em><u>hidden link</u></em>
301 Moved Permanently
<em><u>hidden link</u></em>
302 Found
<em><u>hidden link</u></em>
301 Moved Permanently
<em><u>hidden link</u></em>
200 OK

Please check and make sure it works fine, so I can access it and login.

Regards,
Drazen

March 27, 2025 at 11:48 am #16868226

Patrick

and with this URL?:
hidden link

March 27, 2025 at 12:24 pm #16868403

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

Thanks I checked and found the problem.

In your default language category template "Categories Lake", you are adding custom CSS, same CSS is not being added/ copied to the translated template.

Note, it would be better to add Custom CSS in one place, like Elementor > Custom code, or Appearance> Customize > Additional CSS. That way you have all in one place, and can adjust and keep track of it.

You can manually edit the translated template and add custom CSS there, or, as advised, add all of your CSS to one place, and adjust it how you need it.

.woocommerce ul.products li.product-category a img {
    width: 300 /* S'assure que l'image prend toute la largeur du conteneur */
    height: auto; /* Ajuste la hauteur pour maintenir le ratio si besoin */
    aspect-ratio: 1 / 1; /* Force un format carré */
    object-fit: cover; /* Recadre l'image sans déformation */
}

Regards,
Drazen

Edit _Categories Lake FR_ with Elementor.jpg
March 27, 2025 at 12:50 pm #16868517

Patrick

That was too easy for you 😉
Indeed I had to add a custom code as, after an update, image sizes were not the same anymore.
Thanks for your advice 🙂 I will do that.
Should I check the option "make appear as translated" in elementor?

Best
Patrick

March 27, 2025 at 1:50 pm #16868818

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

thanks. 🙂

I am not sure what you are referring to here, and what you want to check as appear as translated? >"Should I check the option "make appear as translated" in elementor?"

Regards,
Drazen

March 27, 2025 at 2:03 pm #16868893

Patrick

The custom code.
I can check:
translatable, make appear as transalted or make not transatable.
I gues
s these options are related to WPML.

March 27, 2025 at 2:13 pm #16868910

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

You probably mean custom post type translation settings, if so, do not change them. I assume it is set to Not translatable, and it should stay like that, so it applies to languages.

Regards,
Drazen

March 27, 2025 at 6:15 pm #16870100

Patrick

Here a screen shot

Capture.JPG
March 28, 2025 at 7:35 am #16871220

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

as said you should not change this and should stay what was default. As I can see in fresh install it is being set by default "Not translatable"

Regards,
Drazen

March 31, 2025 at 4:42 am #16877336

Patrick

Hi Drazen

Copying the code in elementor didn't bring the expected result but adding it in Appearance> Customize > Additional CSS helped.$
Thank you 🙂

Cheers
Patrick