Home › Forums › Back End › Count posts excluding certain categories › Reply To: Count posts excluding certain categories
January 30, 2015 at 2:28 pm
#194730
Participant
I figured it out. Just needed to add 'cat' => '-71,-72,-73'
to the $args.
<?php
$count_posts = wp_count_posts('sponsors');
$published_posts = $count_posts->publish;
$count = $published_posts/7;
$args = array(
'posts_per_page' => -1,
'post_type' => 'sponsors',
'cat' => '-71,-72,-73'
);
query_posts($args);
?>