• Resolved egornmore

    (@egornmore)


    Hello, how I can remove plugin scripts from pages where plugin is not used? ( such as swiper, easy-ticker, script.js )

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Charles Cormier

    (@charlescormier)

    Hi @egornmore,

    This scripts are needed for advanced post block.
    Thanks!

    Thread Starter egornmore

    (@egornmore)

    I am using Advanced Post Block on one page only, so I don’t want to load unwanted scripts on pages where the plugin is not used.

    Already figured out how to remove swiperJS and easyTicker:

    function dequeue_post_block_scripts() {
    	if( ! is_page( array( 1490, 13843 ) ) ) {
    		wp_dequeue_script( 'swiperJS' );
    		wp_deregister_script( 'swiperJS' );
    		wp_dequeue_script( 'easyTicker' );
    		wp_deregister_script( 'easyTicker' );
    	}
    }
    add_action( 'wp_print_scripts', 'dequeue_post_block_scripts' );

    Can you please guide me how I can dequeue plugin’s CSS?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Remove Unwanted Scripts’ is closed to new replies.