WPML
상태
해결됨
해결된 버전
WPML Multilingual CMS 4.7.4
관련 플러그인/테마
Elementor
주제 태그
Compatibility

문제 개요

WPML과 함께 Elementor 이미지 캐러셀 위젯을 사용할 때, 미디어 라이브러리에서 캡션이 번역되고 페이지가 번역된 경우에도 프런트엔드에 이미지의 번역된 캡션이 표시되지 않습니다.

임시 해결 방법

진행하기 전에 전체 사이트 백업을 완료했는지 확인하세요.


  • 테마의 functions.php 파일을 여세요.

  • 다음 스니펫을 추가하세요.
// WPML Workaround for compsupp-7726
add_filter( 'elementor/frontend/before_render', 'wpml_compsupp7726_filter_imagecarousel_widget');

function wpml_compsupp7726_filter_imagecarousel_widget($element) {
	if ( 'image-carousel' !== $element->get_name() ) {
        return;
    }

    $settings = $element->get_settings();

    if ( isset( $settings['carousel'] ) && is_array( $settings['carousel'] ) ) {
        foreach ( $settings['carousel'] as $key => $value ) {      

            $post_type = get_post_type( $value['id'] );

			if ( ! $post_type ) {
				continue;
			}

			$value['id'] = apply_filters( 'wpml_object_id', $value['id'], $post_type, true );

			unset($settings['carousel'][$key]['id']);
			$settings['carousel'][$key]['id'] = $value['id'];
		}

        $element->set_settings( 'carousel', $settings['carousel'] );
    }
}

  • Elementor 캐시를 지우는 것을 잊지 마세요.
  • 알려진 모든 문제 →