Overview of the Issue
When using Elementor with WPML, you might experience an issue where background images set for mobile and tablet views in the Container element do not reflect the translated versions from Media Translation. While the Desktop version shows the translated image correctly, the original language image continues to appear on Mobile and Tablet.
Workaround
This issue is fixed in WPML Multilingual CMS 4.9. Updating solves it on your site, so you only need this workaround if you can’t update yet.
Please, make sure of having a full site backup of your site before proceeding.
- Add the following code to your theme’s functions.php file.
// WPML - Workaround for compsupp-8108 add_filter( 'wpml_elementor_media_backgrounds_to_translate', function( $background_fields ) { $background_fields['simple_fields'] = $background_fields['simple_fields'] ?? []; $background_fields['simple_fields'][] = 'background_image_mobile'; $background_fields['simple_fields'][] = 'background_image_tablet'; return $background_fields; }); - Make a small edit on your original page and resave its translation.
Still Seeing This Issue?
If updating doesn’t fix it, ask a support question and we’ll look into it with you.
Ask a support question