title: How can I exclude child post from its parent category in Wordpress?
body: <p>I've created category A and then categories B and C which are both child of A. When I visit category A all posts belonging to that category are listed, but it also shows all posts that belongs to category B and C even that those post are not assigned to category A. Is it possible to show only posts under category A and exclude all posts from it childs B and C? I've seen lot of answers but most of then are old and I'm not sure if they work with current version. Also, I'm just starting, and even that I've seen lots of examples of how to overcome this issue it's hard for me to figure where should I make the changes.<br>
  Can you guide me in where and what do I need to change in order to achieve this?
  Thank in advance for your help. </p>
  
  <p>UPDATE</p>
  
  <p>I'm new and can't answer my own questions yet. But I wanted to share what I've found to help anyone else with the same issue. Just place it this code before the loop. </p>
  
  <pre><code>  &lt;?php 
        if ( is_category() ) {
        $cat = get_query_var('cat');
        query_posts(array('category__in' =&gt; array($cat)));
        }?&gt;
  </code></pre>
  
  <p>Thanks to all for your time and help.</p>