One of the nice things about creating a custom loop is being able to specify how many posts you want, using the showposts parameter, like so:
$feat_loop = new WP_Query( 'showposts=12&category_name=featured' ); |
However, it is possible that this query does not return a total of 12 posts (for example if you have less than 12 posts under the Featured category). To get the actual count of returned posts, you use this:
$total_returned_post = $feat_loop->post_count; |