This is the code I am using to display a list of child categories of the parent category while a user is on a child category or single post. Of course, this is in WordPress.
Since I have styled my tags, the styling around this list is displaying even when a list isn’t being generated. For example, [take a look here](http://themeforward.com/demo2/ “”) where you’ll see an empty black box. I’ve colored it black simply to make it stick out. Not sure if this is relevant, but this code is impacted by [another code in my functions.php](http://snippi.com/s/ibw6kgf “”).
I’d simply like a solution to correctly setup the < u l > (sorry for the spaces, had to for display purposes) tag so that it doesn’t display if no list is being generated.
what does the function `wp_list_categories` do? Can you show an example of what it outputs?
Basically, my point is that, when you use `echo`, you’ve committed yourself to making a list (because you’ve already started to *output* a list), so it’s impossible to abort if you discover there is nothing to put in the list.
The solution, therefore, is to 1) make your list, 2) check if it is empty, and *then* 3) decide if you’re going to `echo` it.