Displaying Lists if Category Child
-
I’ve managed to format a piece of php which will grab all of the sub-categories for any given category that you are currently looking in. However, currently this appears on every page, even if the category has no child categories. After much struggling, I have given up on trying to find a solution. I am looking for an ‘if’ statement that will define if the current category has child’s, and then display’s the following code if it does.
<ul id="cat-list">
Note: This category has been split in to several sub-categories for easier browsing. Please click on the following links to narrow your search
<?php
wp_list_cats('sort_column=id&optioncount=0&use_desc_for_title=0&child_of=' . $wp_query->get_queried_object_id() . '');
?>
</ul>If anybody can help, it would be much appreciated!
- The topic ‘Displaying Lists if Category Child’ is closed to new replies.