How to find out the number of posts added to a given category – WordPress

<?php
 $posts = get_posts(array('category' => 5)); // Here 5 is  category id
 echo sizeof($posts);
?>
Share

Leave a Reply

Your email address will not be published. Required fields are marked *