omid @ get_depth()

omid

very good peace of code :D
as for idea i when i was using your code in my theme i face a situation that i have to show categorys only on parent categorys (not last node of category).so i modify your code a bit to check if current category is a parent category or not.here what i ended up with:
if (is_category() ) :
$this_category = get_category($cat);
//get sub categories of current category
$cat_childs = get_categories(array(‘child_of’=>$this_category->cat_ID));
if (sizeof($cat_childs) > 0) : return true;
endif;
endif
hope to be usefull for someone.
endif; …