- Sold between 250 000 and 1 000 000 dollars
- Won a Competition
- Author was Featured
- Item was Featured
- Exclusive Author
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Europe
- Bought between 10 and 49 items
Hi guys,
How can I alter what outputs wp_list_categories? I’m need to put some menu items under particular category and those are simple links, not links to actual categories.
I suppose I’ll need to deal with add_filter but I haven’t worked with it before any help is greatly appreciated.
Thanks! Michael
Hi mixey your best option for this is using the Walker Class, it might be complicated but i don’t see any other way of doing this. Read this post http://www.wprecipes.com/how-to-modify-lists-like-categories-and-blogroll-in-wordpress it should explain or at least guide you a bit
See if that function supports a parameter to not echo output (“echo=0” maybe) and store it in an array, then parse it adding your custom code.
EDIT : Try this
$cats = wp_list_categories('echo=0&title_li=');
$cats = explode("", $cats);
foreach($cats as $cat) {
...
}
You might need some debugging here to see what value $cat has but it may actually work.
