تخطي إلى المحتوى تخطي إلى الشريط الجانبي

Open

Reported for: WPML Multilingual CMS 4.7.6

Topic Tags: Compatibility

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

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.

اترك ردًا

الرجاء البقاء في الموضوع واحترام الآخرين. إذا كنت بحاجة إلى مساعدة في مشكلات غير متعلقة بهذا المنشور، استخدم منتدى الدعم الخاص بنا لبدء محادثة أو تقديم تذكرة.

يمكنك استخدام هذه الوسوم:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>