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.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 14:00 9:00 – 14:00 9:00 – 14:00 9:00 – 14:00 9:00 – 14:00 -
- 15:00 – 18:00 15:00 – 18:00 15:00 – 18:00 15:00 – 18:00 15:00 – 18:00 -

Supporter timezone: Asia/Dhaka (GMT+06:00)

This topic contains 5 replies, has 2 voices.

Last updated by Prosenjit Barman 1 year ago.

Assisted by: Prosenjit Barman.

Author Posts
May 13, 2024 at 11:37 am #15620607

Mandy

Hello,

The background image definition is not working on translated pages. Here an example:

Original version: hidden link (the green/yellow color background)

div.et_pb_section.et_pb_section_0 {
background-size: 60% auto;
background-position: left top;
background-position-x: left;
background-position-y: top;
background-image: url(https://cdn.wpml.org/wp-content/uploads/2022/09/Home_BG_small.svg) !important;
}

Translation: hidden link
On the translation, the image link is definied, but the image detail is missing:

div.et_pb_section.et_pb_section_0 {
background-size: 60% auto;
background-position: left top;
background-image: url(/wp-content/uploads/) !important;
}

I hope you can help me fixing this issue.
Thank you!
Mandy

May 14, 2024 at 8:34 am #15623979

Prosenjit Barman
WPML Supporter since 03/2023

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hi Mandy,
I hope you're doing well.

I checked both the Default and English pages and understood the issue. It seems the background image is added through custom CSS. In the case of custom CSS, you will need to define the CSS one more time by targeting the secondary language. Otherwise, the CSS may not work properly. Please check by adding the CSS rule again for the English language and see if that helps resolve the issue. Here are the steps:

- Please copy the existing CSS code and paste it right below the existing CSS.
- At the beginning of the pasted CSS, add the language selector CSS property "html[lang="en-US"]". Adjust the 'en-US' depending on the language. To find the correct code, inspect the page and check the "lang" attribute within the HTML tag. The CSS for the English language should look like this:

html[lang="en-US"] div.et_pb_section.et_pb_section_0 {
background-size: 60% auto;
background-position: left top;
background-position-x: left;
background-position-y: top;
background-image: url(<em><u>hidden link</u></em>) !important;
}

- Once done, save the changes and check again.

Let me know if the steps above help or if you need further assistance. I will be happy to help.

Best regards,
Prosenjit

May 14, 2024 at 9:59 am #15624644

Mandy

Hi Prosenjit,

thank your for your help! This code works for now, but I think this cannot be the final way to go.

The background image has been added "normally" using the Divi builder, no custom coding involved.

On other pages, which I haven't touched in a while, the background image is showing correctly in both languages. But as soon as I edit a page (only minor text updates), the background images on the translated page disappears.

Is this maybe related to a plugin update issue?

Kind regards,
Mandy

May 15, 2024 at 4:10 am #15627517

Prosenjit Barman
WPML Supporter since 03/2023

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hi Mandy,
Thank you for the update.

Based on the WPML Debug Info, the translation settings for the CSS and other style fields are set to "Copy." This means that style adjustments made within the Divi editor should be copied to the translations without any issues. Additionally, there are also no errors related to Divi CSS being reported.

The issue you're having could be due to the caches. Would you please try the following steps and check again?

- Please clear the caches from your site and Browser. if server-level caching is enabled, clear from there as well.
- Now, go to WPML > Support > troubleshooting.
- Click on the following buttons:

-- Clear the cache in WPML
-- Assign translation status to duplicated content
-- Set language information
-- Fix post-type assignment for translations

- Once done, open any page and make a minor update.
- Update the translation and check if you're still having the issue.

Let me know the update. I will be happy to help if you need further assistance in this matter.

Best regards,
Prosenjit

May 21, 2024 at 6:29 am #15647971

Mandy

Hi Prosenjit,
Thank you! I have done the steps you recommended.
It seems to work - great! 🙂

I was hoping that with this, the other issue (https://wpml.org/forums/topic/divi-css-settings-different-on-translated-page/) would be resolved as well. But I still need to enter the CSS code for the English language seperately in the style.css. Do you know why this happens? Any way to resolve this?

Thanks!
Mandy

May 21, 2024 at 10:13 am #15649542

Prosenjit Barman
WPML Supporter since 03/2023

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hello Mandy,
Thank you for the update.

Glad to hear that the suggestion helped to solve the issue. 🙂

Regarding the CSS issue you reported in the other ticket: If the CSS styles are added via the style controller within the Divi editor, they should be copied to the translation when you add or update the translation. Since you're still experiencing issues, please open the default page in the editor and make slight adjustments to the styles and content.

Once done, clear the caches from your site and browser, then update the translation. It should help in solving the issue.

But, if you need further assistance, please feel free to share the update in the other ticket. I will be happy to help.

Best regards,
Prosenjit

The topic ‘[Closed] Divi theme: Background image link on translation not including file name’ is closed to new replies.