Overview
In this example ‘widget’ is the slug of the parent Category and ( 1 ) is the category ID number.
in_category( 'widget' ) || post_is_in_descendant_category( 1 )
I ran into an problem when a client asked me to show a 300 x 250px banner, only on a specific parent category and it’s child categories.
Step 1: Get the Category ID’s
In your WordPress Dashboard go to Posts > Categories.

Hover over Category Title and Click "Edit."
Once you’ve clicked edit, view your URL bar, look for the number that appears after “ID=”

Step 2: Add the Code to Widget Logic
In your WordPress Dashboard go to Appearance > Widgets
Open the appropriate widget and add the following code to
in_category( 'widget' ) || post_is_in_descendant_category( 1 )
In this example ‘widget’ is the slug of the parent category and ( 1 ) is the category ID number.

Further Reading:
http://wordpress.org/extend/plugins/reveal-ids-for-wp-admin-25/ (< Plugin)
http://www.wprecipes.com/how-to-find-wordpress-category-id
http://yoast.com/showing-subcategories-on-wordpress-category-pages/















