Skip to content

Instantly share code, notes, and snippets.

@mkwebworker
Created August 23, 2013 12:06
Show Gist options
  • Save mkwebworker/6318625 to your computer and use it in GitHub Desktop.
Save mkwebworker/6318625 to your computer and use it in GitHub Desktop.
simple function to count search results. use it with wordpress default search.
/**
* 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