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

Waiting for author

Topic Tags: Compatibility

Overview of the issue

If you are using the Flatsome theme and WPML, when you add its Pages widget and set to showcase a parent page and its children as a Slider, the translations of this page do not display the slider element correctly.

Workaround

Please, make sure of having a full backup of your site before proceeding.

  • Open …/wp-content/themes/flatsome/inc/shortcodes/ux_pages.php file.
  • Inside the ux_pages() function, around line 70, replace the following snippet:
    if($parent) {
      if(!is_numeric($parent)){
        $id = get_page_by_path( $parent );
        $parent = $id->ID;
      }
      $post_id = $parent;
    }
    
  • For:
    if($parent) {
      
      // WPML Workaround for compsupp-7028
      if ( class_exists('Sitepress') && is_numeric($parent)) {
        $post_type = get_post_type($parent);
        $parent = apply_filters( 'wpml_object_id', $parent, $post_type , TRUE  );
      }
    
      if(!is_numeric($parent)){ 
        $id = get_page_by_path( $parent );
        $parent = $id->ID;
      }
      $post_id = $parent;
    }
    

اترك ردًا

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

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