838 posts
  • Power Elite Author: Sold more than $1M on Envato Market
  • Won a competition
  • Became a Top 20 Author of the Month
  • Had an item that was trending
+10 more
wpbakery
says

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

60 posts
  • Has been part of the Envato Community for over 6 years
  • Has referred 50+ members
  • Located in Bolivia, Plurinational State of
  • Has collected 10+ items on Envato Market
+1 more
Slimmity
says

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

415 posts
  • Has referred 10+ members
  • Has sold $250,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Became a Top 20 Author of the Month
+7 more
unisphere
says

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.

by
by
by
by
by
by