Skip Navigation

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 Otto 5 days, 9 hours ago.

Assisted by: Otto.

Author Posts
April 24, 2025 at 4:51 pm #16965535

alexJ-21

Background of the issue:
I have been experiencing an issue with WPML where the translated version of my site is not rendering certain CSS code correctly. The problem seems to be related to WPML as it only affects the translated version. The code is located in Divi > theme builder > global header, and the menu effects CSS is located in Divi > theme settings > custom CSS.

Symptoms:
On the translated version of my site, multiple CSS parts are not working. For example, the underline effect on hover and submenu items on mobile are not displaying correctly. Instead of being under a + icon, all items show up.

Questions:
How can I fix the CSS rendering issue on the translated version of my site?

April 24, 2025 at 6:26 pm #16965824

Otto
WPML Supporter since 09/2015

Languages: English (English ) Spanish (Español )

Timezone: America/Argentina/Buenos_Aires (GMT-03:00)

Hello,

To be able to investigate the problem, we need to replicate the issue on a clean installation.
I created a clean installation of WordPress, WPML, and all necessary WPML add-ons and Divi.
You can access the WordPress dashboard using the link below:
hidden link

Kindly follow the steps below:

- Don't restore your site there.
- Try to replicate the issue with minimal steps.
- Then let me know the steps to see the problem and reproduce it.

Best Regards,
Otto

April 24, 2025 at 7:00 pm #16965922

alexJ-21

I have installed the header now with some code added at Divi > theme settings > custom CSS. That's the code for the underline effect that only works in the main language not when translated. That is the same on the new install. But for some reason the mobile menu works on both languages on the new install with + icons for submenus but not on my website. Any idea why? I have tried disabling all plugins except WPML but it still did not work.

The underline effect does work for the language switcher but not for the other menu items on both sites.

April 24, 2025 at 7:33 pm #16966037

Otto
WPML Supporter since 09/2015

Languages: English (English ) Spanish (Español )

Timezone: America/Argentina/Buenos_Aires (GMT-03:00)

Hello,

The CSS is applied in both languages, but the CSS styles implemented for the English version of your website do not apply to the Swedish version primarily due to differences in HTML structure and missing class names in the Swedish menu markup.

Identified Issues:

  • Missing Wrapper Classes: The Swedish menu lacks the
    dd-me-002

    and

    dd-dme-7b

    classes on its parent elements. These classes are essential for the CSS selectors to target the menu items correctly.

  • Absent
    <span>

    Tags: In the English menu, each

    <a>

    tag wraps its text within a

    <span>

    tag, which is crucial for the underline hover effect. The Swedish menu items are missing these

    <span>

    tags.

  • Suggestions:

    1. Synchronize Menu Structures: Ensure that both English and Swedish menus have identical HTML structures, including all necessary wrapper classes and
      <span>

      tags within

      <a>

      elements.

    2. Utilize WPML's Menu Synchronization: WPML offers a feature to synchronize menus across different languages. Navigate to WPML > WP Menus Sync and follow the prompts to align your menus. For detailed guidance, refer to WPML's documentation on Translating Menus.
    3. Inspect and Modify Menu Templates: If you're using a theme builder like Divi, ensure that the header templates are correctly translated and include all necessary classes and HTML structures. You can manage and translate these templates via WPML > Translation Management.
    4. Verify Language Switcher Configuration: Check that the language switcher is correctly configured and styled for all languages. WPML allows customization of the language switcher through WPML > Languages > Menu Language Switcher. For more information, see WPML's guide on Language Switcher Options.

Additional Resources:

Best Regards,
Otto

April 24, 2025 at 7:55 pm #16966161
alexJ-21

I managed to fix the HTML <span> tags by creating a custom translated menu for english, thanks! But I still can't find the reason why the mobile menu code doesn't work since it worked in the sandbox. I downloaded the layouts from the site so the configuration is the same. Is there some bug or something you can see causing it?

New threads created by Otto and linked to this one are listed below:

https://wpml.org/forums/topic/divi-mobile-menu-code-doesnt-work/

April 24, 2025 at 7:58 pm #16966167

Otto
WPML Supporter since 09/2015

Languages: English (English ) Spanish (Español )

Timezone: America/Argentina/Buenos_Aires (GMT-03:00)

Great, thanks!

As the original issue of this ticket is fixed, I created a new one to tackle the other problem.

Let's continue here:
https://wpml.org/forums/topic/divi-mobile-menu-code-doesnt-work/

Best Regards,
Otto