Hello,
I am using a dual-layer navigation, with wp_list_categories making the upper nav and the following code for generating the lower navigation with the children in necessary:
<?php
$cat = get_query_var('cat');
$category = get_category ($cat);
if ($category->cat_ID) {
if($category->category_parent)
$children = wp_list_categories("orderby=id&hide_empty=0&title_li=&child_of=".$category->category_parent."&echo=0");
else $children = wp_list_categories("orderby=id&hide_empty=0&title_li=&child_of=".$category->cat_ID."&echo=0");
if ($children) {
echo $children; }
}
?>
First, if there are no children, it shows "no categories" in my lower navigation instead of showing nothing at all. How can I get it to return nothing in the case that there are no children?
Second, I have the code in the header and it works very well for the archive based pages I have, but I lose the lower navigation when I go to single post view. How can I get the lower navigation to show up in single view?
Thanks!