Skip to content

Instantly share code, notes, and snippets.

@helgatheviking
Created January 6, 2021 19:50
Show Gist options
  • Save helgatheviking/58d1f43970a745f250e9c9599784236b to your computer and use it in GitHub Desktop.
Save helgatheviking/58d1f43970a745f250e9c9599784236b to your computer and use it in GitHub Desktop.
Code snippet for dequeing a script on the single produt page
function kia_unload_script() {
if ( function_exists( 'is_product' ) && is_product() ) {
wp_dequeue_script( 'wc-single-product' );
}
}
add_action( 'wp_enqueue_scripts', 'kia_unload_script', 20 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment