Im trying to echo the products attribute labels inside a class in a woocommerce loop.
I have tried:
class="<?php echo wc_attribute_label( $name ); ?>"
but it doesn’t work. What am I doing wrong?
Thanks for any help possible!
Kind regards,
Richard
Thanks to Kharis Sulistiyono i got this answer in the wordpress/woocommerce forums:
It works like a charm!
You can do this:
This gives you a term object, so if you for instance want the labels slug you can just:
Or ID: