Wordpress search results data
<div class="search-results-header">
<h1>Search Results</h1>
<p>You searched for <span>"<?php echo esc_html( get_search_query( false ) ); ?>"</span>
<strong>
<?php
$post_type = get_query_var( 'post_type', NULL );
$obj = get_post_type_object( $post_type );
$category_name = get_query_var( 'category_name', NULL );
if($post_type != 'any'){
?>
<?php echo $obj->labels->singular_name;?>
<?php } elseif ($category_name !="") { ?>
in <?php ucfirst(single_cat_title('',true)); ?>
<?php } ?>
</strong>
</p>
<p><?php
global $wp_query;
echo $wp_query->found_posts;
if ($wp_query->found_posts > 1) {
echo " results";
} else {
echo " result";
}
echo " found";
?></p>
</div>
<!-- search-results-header -->