Loại bỏ code kk Star Ratings ra khỏi các trang không cần thiết

1. Mở file functions.php của theme (hoặc child theme) mà bạn đang sử dụng thông qua File Manager của cPanel/ DirectAdmin hoặc FTP. Thêm đoạn code sau đây vào bên trong.

Code:

//* Remove kk Star Ratings from Homepage and Archives
add_action('wp_head','my_conditional_script',0);
function my_conditional_script() {
    if (is_home() || is_category() || is_tag() || is_author()){
   
        global $kkStarRatings_obj;
        remove_action('wp_enqueue_scripts', array($kkStarRatings_obj, 'js'));
 remove_action('wp_enqueue_scripts', array($kkStarRatings_obj, 'css'));
 remove_action('wp_head', array($kkStarRatings_obj, 'css_custom'));
 
    }
}


2. Lưu lại và xem kết quả.