You’ll have to get the child or parent categories yourself and pass all the IDs as an array via the category__in
argument of WP_Query. You can use get_ancestors
to get the top parent category, and get all child categories of that parent via the child_of
argument of get_categories
.