As I’ve been searching for the same functionality for too long now, I’ve written one on my own.
is_child( “ParentCategory” )
is_child( 10 )
is_child( “a-nice-slug” )
Works for categories, posts and pages as well. As for posts, it checks all of a posts categories and all of their parents. Recursively. Or not, if you don’t want it to.
Check it out at
https://erik.range-it.de/wordpress/plugins/is_child/
If you got any ideas, hints, helps or bugs, please leave your feedback.