WPML

סקירת התקלה

בעת שימוש בווידג’ט Post Carousel מהתוסף Unlimited Elements for Elementor באתר עם WPML, הווידג’ט אינו מצליח לשלוף פוסטים מתורגמים, דבר הגורם לבעיות בתצוגת התוכן בעמודים מתורגמים.

פתרון עוקף

בעיה זו תוקנה. עדכון לגרסה העדכנית ביותר פותר זאת באתר שלך, לכן אתה זקוק לפתרון עוקף זה רק אם עדיין אינך יכול לעדכן.

אנא ודא שיש לך גיבוי מלא של האתר לפני שתמשיך.

  • פתח את הקובץ functions.php של ערכת העיצוב שלך.
  • הוסף את הקוד הבא:
    PHP
    // WPML Workaround for compsupp-7126
    add_filter( 'elementor/frontend/before_render', 'wpml_compsupp7126_filter_ucaddon_post_carousel');
    
    function wpml_compsupp7126_filter_ucaddon_post_carousel($element) {
        if ( 'ucaddon_post_carousel' !== $element->get_name() ) {
            return;
        }
    
        $settings = $element->get_settings();
    
        if ( isset( $settings['post_manual_select_post_ids'] ) && is_array( $settings['post_manual_select_post_ids'] ) ) {
            foreach ( $settings['post_manual_select_post_ids'] as $key => $id ) {      
    
                $post_type = get_post_type( $id );
    
                if ( ! $post_type ) {
                    continue;
                }
    
                $id = apply_filters( 'wpml_object_id', $id, $post_type, true );
    
                unset($settings['post_manual_select_post_ids'][$key]);
                $settings['post_manual_select_post_ids'][] = $id;
            }
    
            $element->set_settings( 'post_manual_select_post_ids', $settings['post_manual_select_post_ids'] );
        }
    }

כל התקלות הידועות

עדיין נתקל בבעיה זו?

אם העדכון אינו פותר זאת, פתח פנייה לתמיכה ואנו נבדוק זאת יחד איתך.