• Resolved TheVault

    (@brandontvc)


    Hello,

    It looks like MasterSlider is loading CSS Files across all pages. This is despite the “Load assets on all pages?” option being turned OFF.

    The two lines in the header on ALL pages;

    <link rel='stylesheet' id='msl-main-css'  href='http://mysite/wp-content/plugins/master-slider/public/assets/css/masterslider.main.css?ver=2.9.7' type='text/css' media='all' />
    <link rel='stylesheet' id='msl-custom-css'  href='http://mysite/files/master-slider/custom.css?ver=2.1' type='text/css' media='all' />

    I have a function below but i’m not sure how to actually target these two css files from being queued?

    function my_deregister_javascript() {
    	if ( ! is_front_page() ) {
            wp_dequeue_style('css file one');
            wp_dequeue_style('css file two');
        }
    }
    add_action( 'wp_print_scripts', 'my_deregister_javascript');

    Thanks!

    • This topic was modified 9 years, 1 month ago by TheVault.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor averta support

    (@averta_support)

    Hi,

    Thank you for using Master Slider.

    I forwarded this issue to our dev team.

    You can use this code in order to load assets:

    add_filter( 'wp_enqueue_scripts', function(){
      if( ! is_front_page() ) {
        wp_dequeue_style( 'msl-main' );
        wp_dequeue_style( 'msl-custom' );
      }
    }, 19 );

    Please let me know if I can provide any further assistance.

    Best,
    Averta

    Thread Starter TheVault

    (@brandontvc)

    Work’s perfectly, thanks!

    Much appreciated.

    Plugin Contributor averta support

    (@averta_support)

    I’m glad it has been resolved @brandontvc 🙂

    If you are satisfied with our product and services, we would greatly appreciate your taking the time to give Master Slider a review.

    Have a nice time.

    Best,
    Averta

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘CSS Files loading on all pages’ is closed to new replies.