Tổng quan về sự cố
Người dùng giao diện WoodMart có thể gặp sự cố trong đó các slide được dịch hiển thị trên slider của ngôn ngữ mặc định. Thay vào đó, khi chuyển đổi ngôn ngữ, các slide được dịch lại hoàn toàn không xuất hiện.
Tài liệu hiện tại: Cập nhật WoodMart lên phiên bản mới nhất. Các slide của WoodMart được dịch bằng WPML. Đọc cách thực hiện trong Dịch cửa hàng WoodMart bằng WPML.
Giải pháp tạm thời
Vui lòng đảm bảo đã sao lưu toàn bộ trang web trước khi tiếp tục.
Phần I
- Mở tệp …/wp-content/themes/woodmart/inc/shortcodes/slider.php.
- Tìm dòng 103.
- Thay thế:
$args = array( 'posts_per_page' => -1, 'post_type' => 'woodmart_slide', 'orderby' => 'menu_order', 'order' => 'ASC', 'tax_query' => array( // phpcs:ignore array( 'taxonomy' => 'woodmart_slider', 'field' => 'id', 'terms' => $slider_term->term_id, ), ), );
- Bằng:
$args = array( 'posts_per_page' => -1, 'post_type' => 'woodmart_slide', 'orderby' => 'menu_order', 'order' => 'ASC', 'suppress_filters' => false, 'tax_query' => array( // phpcs:ignore array( 'taxonomy' => 'woodmart_slider', 'field' => 'id', 'terms' => $slider_term->term_id, ), ), );
Phần II
- Mở tệp …/wp-content/themes/woodmart/inc/integrations/wpml/wpml.php.
- Tìm dòng 28.
- Thay thế:
$widgets['wd_slider'] = array( 'conditions' => array( 'widgetType' => 'wd_slider' ), 'fields' => array( array( 'field' => 'slider', 'type' => esc_html__( '[Slider] - Slider', 'woodmart' ), 'editor_type' => 'LINE', ), ), );
- Bằng:
/*$widgets['wd_slider'] = array( 'conditions' => array( 'widgetType' => 'wd_slider' ), 'fields' => array( array( 'field' => 'slider', 'type' => esc_html__( '[Slider] - Slider', 'woodmart' ), 'editor_type' => 'LINE', ), ), );*/