Yes I got " No Categories " :D
as far as my luck is concerned " EXPECT THE WORST "
Also, What will happen if the child has two parents? I will make sure that this never happen but still, If i want to create a theme for public distribution, I must think about this.
If you may like to know:
In my test blog, I have created:
- 3 parent categories
- 3 Child for each
- no post under UNCATEGORIZED
and here is what i tried to do after your reply
Code from my Sidebar.php
<h2>Categories</h2>
<?php
if(empty($wp_query->post->post_parent)){
$parent = $wp_query->post->ID;
}
else{
$parent = $wp_query->post->post_parent;
}
wp_list_categories('show_count=0&hierarchical=0&title_li=&child_of=$parent'); ?>