Skip to content

Instantly share code, notes, and snippets.

@webtoffee-git
Created August 29, 2024 08:58
Show Gist options
  • Save webtoffee-git/de4245c86f8f397246bc920711f91092 to your computer and use it in GitHub Desktop.
Save webtoffee-git/de4245c86f8f397246bc920711f91092 to your computer and use it in GitHub Desktop.
Code to hide add to cart button from related products widget - By Webtoffee (Related Products - Product Recommendations for WooCommerce )
<?php //do not copy this line of code
add_action('wp_footer',function() {
if( class_exists('Custom_Related_Products')) {
?>
<style>
.wt-crp-content-wrapper > .wt_cart_button {
display: none;
}
.wt-related-products > .products > .product > .button.nbo_ajax_add_to_cart {
display: none;
}
</style>
<?php
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment