Okay, these requests are a little older, but in case somebody comes looking for just this: I got equally frustrated today because WP doesn’t seem to have a condition for that, so I wrote one.
This is custom-made for my site, so no guarantees. Also, because I only needed it in that context, the function expects $catarray to be an array. If you’re only looking for one category, either enter it as an array of one or add an extra condition (if (!is_array) or something) to the function. It’s all pretty bare-bones, too, no checking if the post actually has a chapter and if a function by that name already exists and all that. Feel free to use it as a starting point. Other than that, you should be able to just copy this to your function.php, then use “in_subcategory()” in Widget Logic:
function in_subcategory ($catarray) {
$currentcatz = get_the_category( $post->ID );
foreach ($catarray as $catid) {
foreach ($currentcatz as $currentcat) {
if ( cat_is_ancestor_of( $catid, $currentcat->cat_ID ) )
{ return true; }
else
{ return false; }
}
}
}