Before I start, I'm asking for your help because I have very basic html and css skills, and absolutely no php knowledge !
I wanted to display the subcategories on category.php template, below the caterogy title and description. I found a code on stackoverflow which works perfectly (to which I added a div class) :
<div class="sub-cat-inline"><?php
// if the page visitor views is a category page
if (is_category())
{
$cur_cat = get_query_var('cat');
if ($cur_cat)
{
$new_cats = wp_list_categories('echo=false&child_of=' . $cur_cat . '&depth=1&title_li=&hide_empty=0');
echo '<ul>' . $new_cats . '</ul>';
}
}
?>
</div>
However, when charging a page of a category or subcategory not containing any subcategory, there is this text being displayed : "No category".
In the php code above, is it possible to hide any text when there is no subcategory ? Thanks a lot
If anyone interested, below is the basic css used to style the div :
.sub-cat-inline li {
width: 100%;
display: inline;
padding: 10px;
}
.sub-cat-inline {
text-align: center;
}