- 상태
- 개발자가 해결함
- 관련 플러그인/테마
- Hestia Pro
- 주제 태그
- Compatibility
문제 개요
Hestia Pro 테마를 사용하는 경우, 레이아웃에 사용 가능한 번역과 관계없이 외모 > 사용자 정의 레이아웃에서 생성된 사용자 정의 푸터 레이아웃이 기본 언어로만 표시되는 문제가 발생할 수 있습니다.
임시 해결 방법
진행하기 전에 사이트의 전체 백업을 완료했는지 확인하세요.
- …/wp-content/themes/hestia-pro/inc/addons/modules/custom_layouts/class-hestia-custom-layouts-module.php 파일을 여세요.
- 210번째 줄을 찾으세요.
- 다음 부분을:
private function map_custom_layouts() { if ( $this->is_builder_preview() ) { return true; } $cache = get_transient( 'custom_layouts_posts_map' ); if ( ! empty( $cache ) ) { self::$post_map = $cache; return true; } $query = new WP_Query( array( 'post_type' => 'hestia_layouts', 'posts_per_page' => 100, 'no_found_rows' => true, 'update_post_meta_cache' => false, 'update_post_term_cache' => false, 'fields' => 'ids', 'post_status' => 'publish', ) ); if ( ! $query->have_posts() ) { return false; } foreach ( $query->posts as $pid ) { $layout = get_post_meta( $pid, 'custom-layout-options-layout', true ); $priority = get_post_meta( $pid, 'custom-layout-options-priority', true ); if ( $layout === 'hooks' ) { $layout = get_post_meta( $pid, 'custom-layout-options-hook', true ); } self::$post_map[ $layout ][ $pid ] = $priority; } set_transient( 'custom_layouts_posts_map', self::$post_map, DAY_IN_SECONDS ); return true; } - 다음으로 변경하세요:
private function map_custom_layouts() { if ( $this->is_builder_preview() ) { return true; } // Get the current language code $current_language = apply_filters('wpml_current_language', NULL); // Fallback to WPML's current language // Modify the transient key to include the current language $wpml_transient_key = 'custom_layouts_posts_map_' . $current_language; $cache = get_transient( $wpml_transient_key ); if ( ! empty( $cache ) ) { self::$post_map = $cache; return true; } $query = new WP_Query( array( 'post_type' => 'hestia_layouts', 'posts_per_page' => 100, 'no_found_rows' => true, 'update_post_meta_cache' => false, 'update_post_term_cache' => false, 'fields' => 'ids', 'post_status' => 'publish', ) ); if ( ! $query->have_posts() ) { return false; } foreach ( $query->posts as $pid ) { $layout = get_post_meta( $pid, 'custom-layout-options-layout', true ); $priority = get_post_meta( $pid, 'custom-layout-options-priority', true ); if ( $layout === 'hooks' ) { $layout = get_post_meta( $pid, 'custom-layout-options-hook', true ); } self::$post_map[ $layout ][ $pid ] = $priority; } set_transient( $wpml_transient_key, self::$post_map, DAY_IN_SECONDS ); return true; } - 그런 다음, 트랜지언트를 삭제하세요.