- สถานะ
- รอผู้พัฒนา
- ปลั๊กอิน/ธีมที่เกี่ยวข้อง
- FacetWP
- แท็กหัวข้อ
- Compatibility
ภาพรวมของปัญหา
หากคุณกำลังใช้ปลั๊กอิน FacetWP คุณอาจพบปัญหาที่ป้ายกำกับของฟิลด์ checkbox ซึ่งสร้างด้วย ACF และนำไปใช้ใน facet ของ FacetWP ไม่แสดงการแปลเมื่อถูกแทรกลงในหน้าโดยใช้ shortcode ของ Elementor
วิธีแก้ปัญหาชั่วคราว
โปรดตรวจสอบให้แน่ใจว่าได้ทำการสำรองข้อมูลอย่างสมบูรณ์สำหรับเว็บไซต์ของคุณก่อนดำเนินการต่อ
- เปิดไฟล์ functions.php ของธีมของคุณ
- เพิ่มโค้ดต่อไปนี้:
Add the following code to the functions.php file // WPML Workaround for compsupp-6751 function wpml_compsupp6751_translate_facet_display_value( $label, $args ) { if ( class_exists('Sitepress') ) { $wpml_default_lang = apply_filters('wpml_default_language', NULL ); $wpml_current_lang = apply_filters( 'wpml_current_language', NULL ); if ($wpml_default_lang == $wpml_current_lang ) { do_action( 'wpml_register_single_string', 'FacetWP', 'Facet Display Value : '.substr($label, 0, 10), $label ); } // Apply the translation to the string $label = apply_filters('wpml_translate_single_string', $label , 'FacetWP', 'Facet Display Value : '.substr($label, 0, 10) ); } return $label; } add_filter( 'facetwp_facet_display_value', 'wpml_compsupp6751_translate_facet_display_value', 10, 2 ); - ไปที่หน้าบนส่วนหน้าเว็บไซต์ในภาษาต้นฉบับเพื่อลงทะเบียนสตริง
- ไปที่ WPML > การแปลสตริง และแปลสตริง (FacetWP textdomain / Facet Display Value : * name)