Created
August 23, 2013 12:06
-
-
Save mkwebworker/6318625 to your computer and use it in GitHub Desktop.
simple function to count search results. use it with wordpress default search.
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
/** | |
* Count Search Results | |
* http://marcokuemmel.de | |
**/ | |
function count_results($return = false){ | |
global $wp_query; | |
if($return == true )return $wp_query->found_posts; | |
else echo $wp_query->found_posts; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment