- สถานะ
- แก้ไขแล้วโดยผู้พัฒนา
- รายงานสำหรับ
- WPML SEO 2.1.0
- แก้ไขใน
- SEOPress 8.4
- ปลั๊กอิน/ธีมที่เกี่ยวข้อง
- SEOPress
- แท็กหัวข้อ
- Compatibility
ภาพรวมของปัญหา
เมื่อใช้ปลั๊กอิน SEOPress ร่วมกับ WPML slug ของคลังเก็บสินค้าจะไม่ได้รับการแปลอย่างถูกต้องในไซต์แมป XML ที่สร้างโดย SEOPress
วิธีแก้ปัญหาชั่วคราว
โปรดตรวจสอบให้แน่ใจว่าได้สำรองข้อมูลไซต์ทั้งหมดของคุณก่อนดำเนินการต่อ
- เปิดไฟล์ …/wp-content/plugins/wp-seopress/templates/sitemap/single.php
- ค้นหาบรรทัดที่ 41
- แทนที่:
// WPML Workaround if (class_exists('SitePress')) { if ( 2 != apply_filters( 'wpml_setting', false, 'language_negotiation_type' ) ) { $original_language = apply_filters( 'wpml_current_language', NULL ); $language_list = apply_filters( 'wpml_active_languages', NULL, 'orderby=id&order=desc' ); if (!empty($language_list)) { foreach ($language_list as $key => $language_infos ) { if ($original_language != $language_infos['language_code']) { // Switch Language do_action( 'wpml_switch_language', $language_infos['language_code']); $archive_links[] = htmlspecialchars(urldecode(user_trailingslashit(get_post_type_archive_link($path)))); // Restore language to the original do_action( 'wpml_switch_language', $original_language); } } } } - ด้วย:
// WPML Workaround for compsupp-7538 and compsupp-6419 if ( class_exists('SitePress' )) { if ( 2 != apply_filters( 'wpml_setting', false, 'language_negotiation_type' ) ) { $original_language = apply_filters( 'wpml_current_language', NULL ); $language_list = apply_filters( 'wpml_active_languages', NULL, 'orderby=id&order=desc' ); if (!empty($language_list)) { foreach ($language_list as $key => $language_infos ) { if ($original_language != $language_infos['language_code']) { // Switch Language do_action( 'wpml_switch_language', $language_infos['language_code']); if ( $path == 'product' && function_exists('wc_get_page_id') ) { $shop_page_id = wc_get_page_id('shop'); $archive_links[] = htmlspecialchars(urldecode(user_trailingslashit(get_permalink($shop_page_id)))); } else { $archive_links[] = htmlspecialchars(urldecode(user_trailingslashit(get_post_type_archive_link($path)))); } // Restore language to the original do_action( 'wpml_switch_language', $original_language); } } } } }