called unnecessary js and css request
http://www.example.com/wp-content/plugins/includes/js/jquery.form.min.js
http://www.example.com/wp-content/plugins/includes/js/scripts.js
orignal it was
http://www.example.com/wp-content/plugins/contact-form-7/includes/js/jquery.form.min.jshttp://www.serpentcs.com/wp-content/plugins/contact-form-7/includes/js/scripts.js这是在我在中编写函数后发生的function.php
// below function is used to deque script on certain page
function wpa_scripts() {
// if this is not the contact page, remove the script
if(!is_page(\'contact-us\') ){
wp_dequeue_script( \'contact-form-7\' ); // only available onto contact-form-7
}
if(is_page( \'contact-us\' ) || is_page(\'blog-serpent-consulting-service\')){
wp_dequeue_script( \'themepunchtools\' );
wp_dequeue_script( \'fancybox\' );
wp_dequeue_script( \'showbiz-jquery.themepunch.showbizpro.min\' );
wp_dequeue_script( \'prettyphoto-js\' );
wp_dequeue_script( \'owl-js\' );
wp_dequeue_script( \'revmin\' );
}
}
//adjust priority to make sure this runs after the plugins add their scripts/styles
add_action( \'wp_print_scripts\', \'wpa_scripts\', 100 );
在我删除一个仍然调用js和css文件的函数之后。
after change add_action( \'wp_print_scripts\', \'wpa_scripts\', 100 );
到add_action( \'wp_enqueue_scripts\', \'wpa_scripts\', 100 );
工作正常所有页面但不在“联系我们”页面
它包含以下链接
http://www.example.com/wp-content/plugins/includes/js/jquery.form.min.js
http://www.example.com/wp-content/plugins/includes/js/scripts.js
我需要
http://www.example.com/wp-content/plugins/contact-form-7/includes/js/jquery.form.min.jshttp://www.serpentcs.com/wp-content/plugins/contact-form-7/includes/js/scripts.js