Get number of post from wordpress query
Posted by navaneeth on May 1, 2013 in Php, Wordpress | No comments yet
If we need to show the number of posts returned from query
First we need to initialize the global variable global $wp_query
And the entire code will be
<?php global $wp_query; echo $wp_query->found_posts; ?>
Leave a Reply