Last active
February 4, 2019 16:47
-
-
Save andykeith/dbdd211d87f888f03646ed34f82b98de to your computer and use it in GitHub Desktop.
WooCommerce Custom Add to Cart - hide add to cart text on shop page only.
This file contains 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
<?php | |
add_filter( 'body_class', function( $classes ) { | |
if ( function_exists( 'is_shop' ) && is_shop() ) { | |
$classes = array_diff( $classes, array( 'wc-add-to-cart-no-text' ) ); | |
} | |
return $classes; | |
}, 20 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment