mkwebworker
8/23/2013 - 12:06 PM

simple function to count search results. use it with wordpress default search.

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;
 }