Skip to content

Instantly share code, notes, and snippets.

@andykeith
Last active February 4, 2019 16:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andykeith/dbdd211d87f888f03646ed34f82b98de to your computer and use it in GitHub Desktop.
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.
<?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