Hide child term posts on parent term pages
I think that the best solution is to hook into the pre_get_posts action hook. First, it is checked if we are in an archive of your custom taxonomy, then set include_children to false for the tax_query argument of the query. add_action( ‘pre_get_posts’, ‘cyb_pre_get_posts’ ); function cyb_pre_get_posts( $query ) { //Assuming the slug of the custom … Read more