Reproducing hierarchical list output from wp_list_categories(), using get_categories()

The most ideal solution for walking over the data is to use the WordPress walker class.

http://codex.wordpress.org/Function_Reference/Walker_Class

You won’t find many an example around the web for using it, but one was given by Scribu here.

http://scribu.net/wordpress/extending-the-category-walker.html

You can also look to the classes WordPress uses to extend the walker as further examples.

http://core.trac.wordpress.org/browser/tags/3.0.1/wp-includes/classes.php

Hope that helps..

Leave a Comment