Your solution won’t work, because $ep_category->category_parent
is ID (integer) and not slug (string). So this comparison doesn’t make any sense… 😉
One way to do this would be this function (from Codex):
if ( ! function_exists( 'post_is_in_descendant_category' ) ) {
function post_is_in_descendant_category( $cats, $_post = null ) {
foreach ( (array) $cats as $cat ) {
// get_term_children() accepts integer ID only
$descendants = get_term_children( (int) $cat, 'category' );
if ( $descendants && in_category( $descendants, $_post ) )
return true;
}
return false;
}
}
After adding it to your theme, you can use it this way:
if ( in_category( 'watch-isatv' ) || post_is_in_descendant_category( 11 ) ) ... // where 11 is 'watch-isatv' category ID