Answer the question
In order to leave comments, you need to log in
How to get category slug in category listing in Woocommerce?
Hello!
In the category listing, i.e. in the content-product_cat.php template, I need to get the name of the anchor (slug) of each category.
I want to add this label data attribute to the li list.
Those. I want to get something like this:
<li <?php wc_product_cat_class( '', $category ); ?> data-name="<?php echo product_cat_slug; ?>">
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question