Last active
May 14, 2021 04:39
-
-
Save wbcomdev/3e9888a0dacce9791bc82970bbd50231 to your computer and use it in GitHub Desktop.
This 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 characters
| /** | |
| * Remove product content based on category. | |
| */ | |
| function wb_remove_product_content() { | |
| // If a product in the 'Music' category is being viewed. | |
| if ( is_product() && has_term( 'Music', 'product_cat' ) ) { | |
| // Remove the images. | |
| remove_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_images', 20 ); | |
| // For a full list of what can be removed please see woocommerce-hooks.php. | |
| } | |
| } | |
| add_action( 'wp', 'wb_remove_product_content' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment