Last active
          November 26, 2024 23:20 
        
      - 
      
- 
        Save gregrickaby/2846416 to your computer and use it in GitHub Desktop. 
Revisions
- 
        gregrickaby revised this gist Nov 10, 2017 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewingThis 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 charactersOriginal file line number Diff line number Diff line change @@ -18,7 +18,8 @@ function grd_woocommerce_script_cleaner() { wp_dequeue_style( 'woocommerce_fancybox_styles' ); wp_dequeue_style( 'woocommerce_chosen_styles' ); wp_dequeue_style( 'woocommerce_prettyPhoto_css' ); wp_dequeue_script( 'selectWoo' ); wp_deregister_script( 'selectWoo' ); wp_dequeue_script( 'wc-add-payment-method' ); wp_dequeue_script( 'wc-lost-password' ); wp_dequeue_script( 'wc_price_slider' ); 
- 
        gregrickaby revised this gist May 25, 2015 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewingThis 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 charactersOriginal file line number Diff line number Diff line change @@ -9,8 +9,8 @@ function grd_woocommerce_script_cleaner() { // Remove the generator tag remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) ); // Unless we're in the store, remove all the cruft! if ( ! is_woocommerce() && ! is_cart() && ! is_checkout() ) { wp_dequeue_style( 'woocommerce_frontend_styles' ); wp_dequeue_style( 'woocommerce-general'); wp_dequeue_style( 'woocommerce-layout' ); 
- 
        gregrickaby revised this gist May 25, 2015 . 1 changed file with 8 additions and 0 deletions.There are no files selected for viewingThis 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 charactersOriginal file line number Diff line number Diff line change @@ -12,13 +12,20 @@ function grd_woocommerce_script_cleaner() { // If we're on the homepage, remove all the cruft! if ( is_front_page() || is_home() ) { wp_dequeue_style( 'woocommerce_frontend_styles' ); wp_dequeue_style( 'woocommerce-general'); wp_dequeue_style( 'woocommerce-layout' ); wp_dequeue_style( 'woocommerce-smallscreen' ); wp_dequeue_style( 'woocommerce_fancybox_styles' ); wp_dequeue_style( 'woocommerce_chosen_styles' ); wp_dequeue_style( 'woocommerce_prettyPhoto_css' ); wp_dequeue_style( 'select2' ); wp_dequeue_script( 'wc-add-payment-method' ); wp_dequeue_script( 'wc-lost-password' ); wp_dequeue_script( 'wc_price_slider' ); wp_dequeue_script( 'wc-single-product' ); wp_dequeue_script( 'wc-add-to-cart' ); wp_dequeue_script( 'wc-cart-fragments' ); wp_dequeue_script( 'wc-credit-card-form' ); wp_dequeue_script( 'wc-checkout' ); wp_dequeue_script( 'wc-add-to-cart-variation' ); wp_dequeue_script( 'wc-single-product' ); @@ -29,6 +36,7 @@ function grd_woocommerce_script_cleaner() { wp_dequeue_script( 'prettyPhoto-init' ); wp_dequeue_script( 'jquery-blockui' ); wp_dequeue_script( 'jquery-placeholder' ); wp_dequeue_script( 'jquery-payment' ); wp_dequeue_script( 'fancybox' ); wp_dequeue_script( 'jqueryui' ); } 
- 
        gregrickaby renamed this gist May 25, 2015 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewingFile renamed without changes.
- 
        gregrickaby renamed this gist May 25, 2015 . 1 changed file with 12 additions and 8 deletions.There are no files selected for viewingThis 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 charactersOriginal file line number Diff line number Diff line change @@ -1,13 +1,15 @@ <?php //* Do NOT include the opening php tag shown above. Copy the code shown below into functions.php /** * Manage WooCommerce styles and scripts. */ function grd_woocommerce_script_cleaner() { // Remove the generator tag remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) ); // If we're on the homepage, remove all the cruft! if ( is_front_page() || is_home() ) { wp_dequeue_style( 'woocommerce_frontend_styles' ); wp_dequeue_style( 'woocommerce_fancybox_styles' ); @@ -29,4 +31,6 @@ function child_manage_woocommerce_styles() { wp_dequeue_script( 'jquery-placeholder' ); wp_dequeue_script( 'fancybox' ); wp_dequeue_script( 'jqueryui' ); } } add_action( 'wp_enqueue_scripts', 'grd_woocommerce_script_cleaner', 99 ); 
- 
        gregrickaby revised this gist Apr 22, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewingThis 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 charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,7 @@ */ function child_manage_woocommerce_styles() { remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) ); if ( is_front_page() || is_home() ) { wp_dequeue_style( 'woocommerce_frontend_styles' ); wp_dequeue_style( 'woocommerce_fancybox_styles' ); wp_dequeue_style( 'woocommerce_chosen_styles' ); 
- 
        gregrickaby revised this gist Apr 22, 2013 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewingThis 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 charactersOriginal file line number Diff line number Diff line change @@ -1,14 +1,14 @@ add_action( 'wp_enqueue_scripts', 'child_manage_woocommerce_styles', 99 ); /** * Remove WooCommerce Generator tag, styles, and scripts from the homepage. * Tested and works with WooCommerce 2.0+ * * @author Greg Rickaby * @since 2.0.0 */ function child_manage_woocommerce_styles() { remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) ); if ( is_front_page() || is_home() ) { wp_dequeue_style( 'woocommerce_frontend_styles' ); wp_dequeue_style( 'woocommerce_fancybox_styles' ); wp_dequeue_style( 'woocommerce_chosen_styles' ); 
- 
        gregrickaby revised this gist Apr 22, 2013 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewingThis 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 charactersOriginal file line number Diff line number Diff line change @@ -1,12 +1,13 @@ add_action( 'wp_enqueue_scripts', 'child_manage_woocommerce_styles', 99 ); /** * Remove WooCommerce Generator tag, styles, and scripts unless inside the store. * Tested and works with WooCommerce 2.0+ * * @author Greg Rickaby * @since 2.0.0 */ function child_manage_woocommerce_styles() { remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) ); if ( 'product' !== get_post_type() && !is_page( 'shop' ) && !is_page( 'cart' ) && !is_page( 'checkout' ) && !is_page( 'my-account' ) ) { wp_dequeue_style( 'woocommerce_frontend_styles' ); wp_dequeue_style( 'woocommerce_fancybox_styles' ); 
- 
        gregrickaby revised this gist Apr 22, 2013 . 1 changed file with 17 additions and 5 deletions.There are no files selected for viewingThis 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 charactersOriginal file line number Diff line number Diff line change @@ -1,19 +1,31 @@ add_action( 'wp_enqueue_scripts', 'child_manage_woocommerce_styles', 99 ); /** * Remove WooCommerce styles and scripts unless inside the store. * Tested and works with WooCommerce 2.0+ * * @author Greg Rickaby * @since 2.0.0 */ function child_manage_woocommerce_styles() { if ( 'product' !== get_post_type() && !is_page( 'shop' ) && !is_page( 'cart' ) && !is_page( 'checkout' ) && !is_page( 'my-account' ) ) { wp_dequeue_style( 'woocommerce_frontend_styles' ); wp_dequeue_style( 'woocommerce_fancybox_styles' ); wp_dequeue_style( 'woocommerce_chosen_styles' ); wp_dequeue_style( 'woocommerce_prettyPhoto_css' ); wp_dequeue_script( 'wc_price_slider' ); wp_dequeue_script( 'wc-single-product' ); wp_dequeue_script( 'wc-add-to-cart' ); wp_dequeue_script( 'wc-cart-fragments' ); wp_dequeue_script( 'wc-checkout' ); wp_dequeue_script( 'wc-add-to-cart-variation' ); wp_dequeue_script( 'wc-single-product' ); wp_dequeue_script( 'wc-cart' ); wp_dequeue_script( 'wc-chosen' ); wp_dequeue_script( 'woocommerce' ); wp_dequeue_script( 'prettyPhoto' ); wp_dequeue_script( 'prettyPhoto-init' ); wp_dequeue_script( 'jquery-blockui' ); wp_dequeue_script( 'jquery-placeholder' ); wp_dequeue_script( 'fancybox' ); wp_dequeue_script( 'jqueryui' ); }} 
- 
        gregrickaby revised this gist Mar 27, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewingThis 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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ add_action( 'wp_enqueue_scripts', 'child_manage_woo_styles', 99 ); /** * Remove WooCommerce styles and scripts unless inside the store. * Tested and works with WooCommerce 1.0+ and 2.0+ * * @author Greg Rickaby * @since 1.1.0 
- 
        gregrickaby revised this gist Mar 27, 2013 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewingThis 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 charactersOriginal file line number Diff line number Diff line change @@ -11,9 +11,9 @@ function child_manage_woo_styles() { wp_dequeue_style( 'woocommerce_frontend_styles' ); wp_dequeue_style( 'woocommerce_fancybox_styles' ); wp_dequeue_style( 'woocommerce_chosen_styles' ); wp_dequeue_style( 'woocommerce_prettyPhoto_css' ); wp_dequeue_script( 'wc_price_slider' ); wp_dequeue_script( 'woocommerce' ); wp_dequeue_script( 'fancybox' ); wp_dequeue_script( 'jqueryui' ); }} 
- 
        gregrickaby revised this gist Mar 27, 2013 . 1 changed file with 5 additions and 3 deletions.There are no files selected for viewingThis 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 charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,10 @@ add_action( 'wp_enqueue_scripts', 'child_manage_woo_styles', 99 ); /** * Remove WooCommerce styles and scripts unless inside the store. * Works with WooCommerce 2.0+ * * @author Greg Rickaby * @since 1.1.0 */ function child_manage_woo_styles() { if ( 'product' !== get_post_type() && !is_page( 'cart' ) && !is_page( 'checkout' ) ) { @@ -12,6 +13,7 @@ function child_manage_woo_styles() { wp_dequeue_style( 'woocommerce_chosen_styles' ); wp_dequeue_script( 'woocommerce' ); wp_dequeue_script( 'wc_price_slider' ); wp_dequeue_style( 'woocommerce_prettyPhoto_css' ); wp_dequeue_script( 'fancybox' ); wp_dequeue_script( 'jqueryui' ); }} 
- 
        gregrickaby revised this gist May 31, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewingThis 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 charactersOriginal file line number Diff line number Diff line change @@ -6,7 +6,7 @@ * @since 1.0.0 */ function child_manage_woo_styles() { if ( 'product' !== get_post_type() && !is_page( 'cart' ) && !is_page( 'checkout' ) ) { wp_dequeue_style( 'woocommerce_frontend_styles' ); wp_dequeue_style( 'woocommerce_fancybox_styles' ); wp_dequeue_style( 'woocommerce_chosen_styles' ); 
- 
        gregrickaby revised this gist May 31, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewingThis 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 charactersOriginal file line number Diff line number Diff line change @@ -6,7 +6,7 @@ * @since 1.0.0 */ function child_manage_woo_styles() { if ( 'product' !== get_post_type() && !is_page( 'cart' ) ) { wp_dequeue_style( 'woocommerce_frontend_styles' ); wp_dequeue_style( 'woocommerce_fancybox_styles' ); wp_dequeue_style( 'woocommerce_chosen_styles' ); 
- 
        gregrickaby revised this gist May 31, 2012 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewingThis 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 charactersOriginal file line number Diff line number Diff line change @@ -12,6 +12,6 @@ function child_manage_woo_styles() { wp_dequeue_style( 'woocommerce_chosen_styles' ); wp_dequeue_script( 'woocommerce' ); wp_dequeue_script( 'wc_price_slider' ); // wp_dequeue_script( 'fancybox' ); Not using fancybox? Then uncomment this line! // wp_dequeue_script( 'jqueryui' ); Not using jquery-ui? Then uncomment this line! }} 
- 
        gregrickaby revised this gist May 31, 2012 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewingThis 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 charactersOriginal file line number Diff line number Diff line change @@ -12,6 +12,6 @@ function child_manage_woo_styles() { wp_dequeue_style( 'woocommerce_chosen_styles' ); wp_dequeue_script( 'woocommerce' ); wp_dequeue_script( 'wc_price_slider' ); // wp_dequeue_script( 'fancybox' ); Not using fancybox? Then un-comment this line! // wp_dequeue_script( 'jqueryui' ); Not using jquery-ui? Then un-comment this line! }} 
- 
        gregrickaby revised this gist May 31, 2012 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewingThis 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 charactersOriginal file line number Diff line number Diff line change @@ -12,6 +12,6 @@ function child_manage_woo_styles() { wp_dequeue_style( 'woocommerce_chosen_styles' ); wp_dequeue_script( 'woocommerce' ); wp_dequeue_script( 'wc_price_slider' ); // wp_dequeue_script( 'fancybox' ); if you're using fancybox un-comment this line // wp_dequeue_script( 'jqueryui' ); if you're using jqueryui un-comment this line }} 
- 
        gregrickaby revised this gist May 31, 2012 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewingThis 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 charactersOriginal file line number Diff line number Diff line change @@ -1,11 +1,11 @@ add_action( 'wp_enqueue_scripts', 'child_manage_woo_styles', 99 ); /** * Remove WooCommerce styles and scripts unless inside the store. * * @author Greg Rickaby * @since 1.0.0 */ function child_manage_woo_styles() { if ( 'product' !== get_post_type() ) { wp_dequeue_style( 'woocommerce_frontend_styles' ); wp_dequeue_style( 'woocommerce_fancybox_styles' ); 
- 
        gregrickaby created this gist May 31, 2012 .There are no files selected for viewingThis 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ add_action( 'wp_enqueue_scripts', 'child_manage_styles', 99 ); /** * Remove WooCommerce styles and scripts unless inside the store. * * @author Greg Rickaby * @since 1.0.0 */ function child_manage_styles() { if ( 'product' !== get_post_type() ) { wp_dequeue_style( 'woocommerce_frontend_styles' ); wp_dequeue_style( 'woocommerce_fancybox_styles' ); wp_dequeue_style( 'woocommerce_chosen_styles' ); wp_dequeue_script( 'woocommerce' ); wp_dequeue_script( 'wc_price_slider' ); wp_dequeue_script( 'fancybox' ); wp_dequeue_script( 'jqueryui' ); }}