Поместите этот код в functions.php
add_action('pre_get_posts', 'filter_out_children');
function filter_out_children( $query ) {
if ( is_main_query() && is_category() && ! is_admin() ) {
$qo = $query->get_queried_object();
$tax_query = array(
'taxonomy' => 'category',
'field' => 'id',
'terms' => $qo->term_id,
'include_children' => false
);
$query->set( 'tax_query', array($tax_query) );
}
}