Jul 10, 2011

Get how many posts are returned by a custom loop

To get the output, just paste the following snippet anywhere in your themes file.

[php]
$feat_loop = new WP_Query( 'showposts=12&category_name=featured' );
echo "Query returned ".$feat_loop->post_count." posts.";
[/php]

No comments :

Post a Comment