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
$parent = $wp_query->post->ID;
$parent = $wp_query->post->post_parent;