839 posts
  • Power Elite Author
  • Winner
  • Top Monthly Author
  • Trendsetter
+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
  • 6 Years of Membership
  • Affiliate Level 3
  • Bolivia, Plurinational State of
  • Collector Level 2
+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
  • Affiliate Level 2
  • Author Level 9
  • Collector Level 2
  • Top Monthly Author
+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