Add the below code at the end of your theme’s functions.php file or you can also add the below code inside your site-specific plugin.
1 2 3 4 5 6 7 8 9 10 11 12 |
/** * Remove product content based on category */ add_action( 'wp', 'remove_product_content' ); function remove_product_content() { // If a product in the 'Cookware' category is being viewed... if ( is_product() && has_term( 'Cookware', 'product_cat' ) ) { // For a full list of what can be removed please see woocommerce-hooks.php remove_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_images', 20 ); } } |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.