How to add custom HTML to all single product pages except products which belongs to a specific product category?
Add this function in your theme’s functions.php
Just change “127” with ID of category you want to exclude.And of course, change “custom text” part with desired HTML.
In the last line, number “15” will place your code between PRICE and EXCERPT. If you need custom text on some different place, find content–single–product.php file and there in this part:
you will see the order of all elements on product page. You should just pick the number between some of that listed and custom code will be placed there.