Currently, I am utilizing a wordpress slider plugin called Master Slider (https://wordpress.org/plugins/master-slider) on the homepage of my website - http://lanarratrice-al-rawiya.com/lanarratrice
However, I have noticed that even though the slider is only used on the home page, the css and js files associated with the slider are being loaded on all pages, resulting in an increased number of http requests. Is there a way to ensure that the slider css and js files are only loaded on the home page?
I attempted to implement the following code snippet in the functions.php file, as outlined in this resource (http://justintadlock.com/archives/2009/08/06/how-to-disable-scripts-and-styles), but unfortunately, it did not work.
add_action( 'wp_print_scripts', 'my_deregister_javascript', 100 );
function my_deregister_javascript() {
if (!(is_front_page()) {
wp_deregister_script( 'jquery-easing' );
wp_deregister_script( 'masterslider-core' );
}
}
Fortunately, within the Master Slider admin section, there exists an advanced setting that allows for the prevention of the js and css from loading on all pages, which is illustrated in the attached image.