Title: Hide Child Posts
Last modified: August 20, 2016

---

# Hide Child Posts

 *  [andrewhheller](https://wordpress.org/support/users/andrewhheller/)
 * (@andrewhheller)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/hide-child-posts/)
 * Hello,
 * How can I hide child posts under a parent category? For example, if I click on
   a parent category archive I only want to see the posts from that parent category
   and hide all posts from child categories.
 * When I click on the child category archive I’d like to only see the posts from
   that child category.
 * Thanks,
    – Andrew Heler

Viewing 1 replies (of 1 total)

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/hide-child-posts/#post-2209676)
 * you will need to edit category.php (if your theme does not have a category.php,
   make a copy of archive.php and save it as category.php)
 * before the start of the loop, add a custom query;
    example:
 *     ```
       <?php global $wp_query;
       $args = array_merge( $wp_query->query, array( 'category__in' => array(get_query_var('cat'))) );
       query_posts( $args ); ?>
       ```
   
 * [http://codex.wordpress.org/Function_Reference/query_posts#Usage_Note](http://codex.wordpress.org/Function_Reference/query_posts#Usage_Note)

Viewing 1 replies (of 1 total)

The topic ‘Hide Child Posts’ is closed to new replies.

## Tags

 * [child](https://wordpress.org/support/topic-tag/child/)
 * [hide](https://wordpress.org/support/topic-tag/hide/)
 * [posts](https://wordpress.org/support/topic-tag/posts/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [Michael](https://wordpress.org/support/users/alchymyth/)
 * Last activity: [14 years, 9 months ago](https://wordpress.org/support/topic/hide-child-posts/#post-2209676)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
