Show Subcategory Description

wp_list_categories formats the results, instead you want to try get_categories and create your own loop to format the results.

I do not know exactly how you want it formated, but this gives you the general idea.

<?php 
if (is_category()) {
    $this_category = get_category($cat);
    if (get_category_children($this_category->cat_ID) != "") {
        echo "<div id="catlist"><ul>';
        $childcategories = get_categories(array(
            'orderyby' => 'name',
            'hide_empty' => false,
            'child_of' => $this_category->cat_ID
            ));
        foreach($childcategories as $category) {
            echo '<a href="' . get_category_link( $category->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $category->name ) . '" ' . '>' . $category->name.'</a>';
            echo '<p>'.$category->description.'</p>';
        }
        echo '</ul></div>';
    }
}
?>

For more examples and information visit, get_categories

Leave a Comment