Created
April 6, 2017 22:48
-
-
Save seb86/79a8fc5a9ed712aba9c92a562c8a2459 to your computer and use it in GitHub Desktop.
Removes Ajax to run on the frontpage with WC to check if the cart has any items added. Saves about 2 seconds average of load time.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'wp_enqueue_scripts', 'dequeue_woocommerce_cart_fragments', 11); | |
function dequeue_woocommerce_cart_fragments() { | |
if ( is_front_page() ) { | |
wp_dequeue_script('wc-cart-fragments'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment