• Resolved ADvi

    (@advi)


    Hi.

    I’m trying to disable this plugin’s scripts on homepage.
    But wp_dequeue_script doesn’t work for it. How can I achieve this?

    function dequeue_front_page_scripts() {
    	if( is_front_page() ) {
    		wp_dequeue_script( 'cpsw-stripe-elements' );
    		wp_dequeue_script( 'cpsw-stripe-external' );
    		wp_dequeue_script( 'cpsw-express-checkout-js' );			
    	}
    }
    add_action( 'wp_enqueue_scripts', 'dequeue_front_page_scripts' );`
    
    
    • This topic was modified 2 years, 6 months ago by ADvi.
Viewing 1 replies (of 1 total)
  • Plugin Support Aamir

    (@aamiribsf)

    Hello @advi,

    Thanks for choosing our product and writing us.

    We have contacted the developers and they said they could see only CSS files loading in the front end.

    For that, you should use wp_dequeue_style()

    In case you want to deregister any CSS or the script you should hook it with higher priority like
    add_action( ‘wp_enqueue_scripts’, ‘dequeue_front_page_scripts’, 50 );

    Please try and let us know how that goes.

    I hope this helps.

Viewing 1 replies (of 1 total)
  • The topic ‘wp_dequeue_script doesn’t work’ is closed to new replies.