use has_tem for product attribute

Question

I’m using Conditional tags to display specific widget on specific product :
for example :

has_term(‘book’, ‘product_tag’)
or
has_term( array( ‘hyundai’, ‘kia’ ) , ‘pwb-brand’)

now i want use product attribute for conditional tags , for example display widget on products that has "color" attribute with "red" value :
something like this :

hast_term(‘red’ , ‘color’)

how can i do this ?
Thanks in advance

0
Milad Jafari 1 month 0 Answers 11 views 0

Leave an answer