How do I add classes in the wp_list_category , I know the wp_list_categories(‘title_li=’);
generates classes , but I want to add a class in the parent category link
<ul>
<li><a href="#"> link1</a> </li>
<li><a href="#">link2 </a> </li>
<li><a href="#">link3 </a> <---how do I add a special class here
<ul class="children">
<li><a href="#">link3 children </a> </li>
<li><a href="#"> link3 children</a> </li>
</li>
</li>
</ul>
Im planning to use a jquery UI accordion in here,
please help. thank you
-edit–
problem solved by Paul , thanks man
jquery accordion accepts an option called header that allows you to provide a selector to designate the items you want to act as the accordion headers.
I have gotten this to work mainly by reverse-engineering the access-keys plugin. The code is pasted below but feel free to checkout the code for that plugin. It may help you decipher whats going on a little better.
You can change class=”page-‘.$id.'” to whatever you would like. Currently it sets the class to page-[id of page or category]
Add the code to your themes functions.php. If you only want it for categories you can ignore the wp_list_pages filter.
Hope this helps.
There’s a filter in the works:
http://core.trac.wordpress.org/ticket/16497
But in the meantime, a jquery solution might be the best fit for you, since you’re loading jquery anyway.