Created
May 23, 2010 12:28
-
-
Save thom4parisot/410893 to your computer and use it in GitHub Desktop.
WordPress − Returns the number of candidate posts for the current query
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Returns the number of candidate posts for the current query | |
* | |
* Written because I saw some heavy code like that to do the same thing: http://theandystratton.com/2009/show-total-search-results-wordpress-search-template/ | |
* | |
* @version 1.0 | |
* @since 2010-05-23 | |
* @author Oncle Tom <http://case.oncle-tom.net> | |
* @return integer Number of posts found | |
*/ | |
function get_found_posts_count() | |
{ | |
global $wp_query; | |
return $wp_query->found_posts; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment