I want to hide the button on my shop pages, but I would like to show it on other posts and pages.
I\'ve found this code to hide the add to cart button on my whole we
To remove the "Add to cart" button You need to use hook which not affect other code-
add_action( 'woocommerce_after_shop_loop_item', 'remove_loop_button', 1 );
function remove_loop_button()
{
if( is_product_category() || is_shop()) {
remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart');
}
}
this will remove add to cart button from shop/category pages .
Here you can get WooCommerce Action and Filter Hook -https://docs.woothemes.com/wc-apidocs/hook-docs.html