WooCommerce: Show img only on specific products/categories

I'm currently working on a WooCommerce-shop for a client. She is selling jewellery and wants me to display a gold/silver circle underneath the product-title in the product grid (as seen on the screenshot). I know that it works, but I wasn't able to figure it out yet. My idea is something like getting the category with something like that:

<?php if (is_product_category('979')) then do something ?>

i already tried to echo an and inserted this into wc-template-functions.php --> product-title-loop but it did not work out.

Would be glad if somebody could help me! Thanks in advance

the circles should be displayed based on the category

Read more here: https://stackoverflow.com/questions/67935537/woocommerce-show-img-only-on-specific-products-categories

Content Attribution

This content was originally published by waltlin at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: