Exclude a category from a query that includes its parent category
First you should move wp_reset_query(); outside of the loop instead of resetting the query every post of the loop. And as for your query you can use category__not_in $args = array( ‘cat’ => 14, ‘category__not_in’ => array(’45’), ‘posts_per_page’ => 20 ); $the_query = new WP_Query($args); while ($the_query->have_posts()) : $the_query->the_post();?> <li> <a href=”https://wordpress.stackexchange.com/questions/17387/<?php the_permalink() ?>” rel=”bookmark” … Read more