• Resolved hermanndettmann

    (@hermanndettmann)


    I use the bedrock wordpress stack and the sage theme. Using these building blocks I am building new theme and a customized woocommerce shop. Now I added your plugin and it works great! But there is one thing I can’t figure out how to handle: I’d like to remove the widget.min.js at the end of the body to put it in my main.js and do a bit of customization. I tried the following and it doesn’t work:

    wp_enqueue_script( ‘berocket_aapf_widget-script’ );

    or

    wp_deregister_script(‘berocket_aapf_widget-script’);

    What am I doing wrong? I would really appreciate your help!

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

    (@razyrx)

    Hi,

    You need to use something like this

    add_action( 'wp_footer', 'de_script', 1 );
    add_action( 'wp_print_scripts', 'de_script', 100 );
    
    function de_script() {
    	wp_dequeue_script( 'berocket_aapf_widget-script' );
    	wp_deregister_script( 'berocket_aapf_widget-script' );
    	wp_dequeue_script( 'berocket_aapf_widget-hack-script' );
    	wp_deregister_script( 'berocket_aapf_widget-hack-script' );
    	wp_dequeue_script( 'berocket_aapf_widget-scroll-script' );
    	wp_deregister_script( 'berocket_aapf_widget-scroll-script' );
    }

    Regards,
    Oleg

    Thread Starter hermanndettmann

    (@hermanndettmann)

    Thanks Oleg!

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

The topic ‘Remove script from page body’ is closed to new replies.