WPML
สถานะ
เปิด
รายงานสำหรับ
WPML Multilingual CMS 4.4.10

ภาพรวมของปัญหา

หากคุณเพิ่มตัวสลับภาษาในพื้นที่วิดเจ็ต คุณจะสังเกตเห็นว่าตัวเลือกสี Hover ไม่แสดงในส่วนหน้าเว็บไซต์

วิธีแก้ปัญหาชั่วคราว

วิธีแก้ไข:


  • โปรดสำรองข้อมูลไซต์ของคุณอย่างสมบูรณ์ก่อนดำเนินการต่อ

  • เปิดไฟล์ /wp-content/plugins/sitepress-multilingual-cms/classes/language-switcher/class-wpml-ls-inline-styles.php ของคุณในบรรทัดที่ 148

  • แทนที่ส่วนนี้:
    if ( $slot->get( 'font_other_hover' ) || $slot->get( 'background_other_hover' ) ) {
        	$css .= "$wrapper_class a:hover,$wrapper_class a:focus {";
        	$css .= $slot->get( 'font_other_hover' ) ? "color:{$slot->get( 'font_other_hover' )};" : '';
        	$css .= $slot->get( 'background_other_hover' ) ? "background-color:{$slot->get( 'background_other_hover' )};" : '';
        	$css .= '}';
    }


  • ด้วย:
    if ( $slot->get( 'font_other_hover' ) || $slot->get( 'background_other_hover' ) ) {
    	$css .= "$wrapper_class .wpml-ls-item a:hover,$wrapper_class .wpml-ls-item a:focus {";
    	$css .= $slot->get( 'font_other_hover' ) ? "color:{$slot->get( 'font_other_hover' )};" : '';
    	$css .= $slot->get( 'background_other_hover' ) ? "background-color:{$slot->get( 'background_other_hover' )};" : '';
    	$css .= '}';
    }


  • จากนั้นค้นหาบรรทัดที่ 141

  • แทนที่ส่วนนี้:
    if ( $slot->get( 'font_other_normal' ) || $slot->get( 'background_other_normal' ) ) {
    			$css .= "$wrapper_class>a:link {";
    			$css .= $slot->get( 'font_other_normal' ) ? "color:{$slot->get( 'font_other_normal' )};" : '';
    			$css .= $slot->get( 'background_other_normal' ) ? "background-color:{$slot->get( 'background_other_normal' )};" : '';
    			$css .= '}';
    }


  • ด้วย:
    if ( $slot->get( 'font_other_normal' ) || $slot->get( 'background_other_normal' ) ) {
    			$css .= "$wrapper_class .wpml-ls-item a:link {";
    			$css .= $slot->get( 'font_other_normal' ) ? "color:{$slot->get( 'font_other_normal' )};" : '';
    			$css .= $slot->get( 'background_other_normal' ) ? "background-color:{$slot->get( 'background_other_normal' )};" : '';
    			$css .= '}';
    }

ปัญหาที่ทราบแล้วทั้งหมด →