How to add a custom attribute to wp_list_categories links
-
Hi,
I’m trying to add a custom attribute to the links that result from wp_list_categories()
What I’m trying to do is this:
<li><a href="/category-link/" data-filter="name-of-category"></a></li>
I need to add the “data-filter” attribute and set it equal to the category name. How can this be accomplished?
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘How to add a custom attribute to wp_list_categories links’ is closed to new replies.