This default behavior, showing subcategory posts on parent category archive page may be undesirable. To exclude subcategory posts from parent category archive you have to modify the $query.
As it is known that query_posts does not modifiy the main query, but executes new one, this is not the function we would use. It is preferable to use ‚pre_get_posts‘ hook to modify main query. And so I’m using this hook in my simple WordPress snippet for preventing of showing subcategory posts on parent category archive page. Here is the WordPress snippet – insert it into your functions.php
function binda_limit_only_to_one_category( $query ) { //check for main query and apply only on category archive page if ( $query->is_category() && $query->is_main_query() ) { //category__in does not bring posts from subcategories $query->set( 'category__in', array( $query->get('cat') ) ); //unset cat which brings posts from subcategories $query->set( 'cat', '' ); } //return query return $query; } add_action( 'pre_get_posts', 'binda_limit_only_to_one_category' );