I made a mum or dad theme and a baby theme in one in every of my venture. I enqueued CSS and JavaScripts in my mum or dad theme like under:
operate project_necessary_scripts() {
//Stylesheets
wp_register_style( 'bootstrap-css', get_template_directory_uri() .'/css/bootstrap.min.css' );
wp_register_style( 'bootstrap-map', get_template_directory_uri() .'/css/bootstrap.css.map' );
wp_register_style( 'project-css', get_stylesheet_uri() );
wp_enqueue_style( 'bootstrap-css' );
wp_enqueue_style( 'bootstrap-map' );
wp_enqueue_style( 'project-css' );
//JavaScripts
wp_register_script( 'modernizr-js', get_template_directory_uri() .'/js/modernizr-2.8.3.min.js', array(), '2.8.3' );
wp_register_script( 'project-js', get_template_directory_uri() .'/js/venture.min.js', array('jquery'), '20150401', true );
wp_enqueue_script( 'modernizr-js' );
wp_enqueue_script( 'project-js' );
}
add_action( 'wp_enqueue_scripts', 'project_necessary_scripts' );
Now, in my Little one theme I wish to dequeue some stylesheets and javascripts. So I used the next code:
operate project_dequeue_unnecessary_scripts() {
wp_dequeue_style( 'bootstrap-map' );
wp_dequeue_script( 'modernizr-js' );
wp_dequeue_script( 'project-js' );
}
add_action( 'wp_print_scripts', 'project_dequeue_unnecessary_scripts' );
However really the bootstrap.css.map
file remains to be enqueuing, however the modernizr-js project-js just isn’t loading, so it is working partially. How can I resolve that?
I even tried motion priorities:
add_action( 'wp_print_scripts', 'project_dequeue_unnecessary_scripts', 11 );