- สถานะ
- รอผู้พัฒนา
- ปลั๊กอิน/ธีมที่เกี่ยวข้อง
- Flatsome
- แท็กหัวข้อ
- Compatibility
ภาพรวมของปัญหา
หากคุณกำลังใช้ธีม Flatsome และ WPML เมื่อคุณเพิ่มวิดเจ็ต Pages และตั้งค่าให้แสดงหน้าหลักและหน้าย่อยเป็น Slider คำแปลของหน้านี้จะแสดงองค์ประกอบสไลเดอร์ไม่ถูกต้อง
วิธีแก้ปัญหาชั่วคราว
โปรดตรวจสอบให้แน่ใจว่าได้สำรองข้อมูลไซต์ของคุณอย่างครบถ้วนก่อนดำเนินการต่อ
- เปิดไฟล์ …/wp-content/themes/flatsome/inc/shortcodes/ux_pages.php
- ภายในฟังก์ชัน
ux_pages()ประมาณบรรทัดที่ 70 ให้แทนที่ข้อมูลโค้ดต่อไปนี้:if($parent) { if(!is_numeric($parent)){ $id = get_page_by_path( $parent ); $parent = $id->ID; } $post_id = $parent; } - ด้วย:
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; }