Wordpress search results header


/ Published in: PHP
Save to your folder(s)

prints "We found 'N' result(s) for 'QUERYSTRING'"


Copy this code and paste it in your HTML
  1. <?php
  2. global $wp_query;
  3. $total_results = $wp_query->found_posts;
  4. ?>
  5. <h3>We found <?php echo $total_results; ?> result<?php echo $total_results == 1 ? '' : 's' ; ?> for "<?php the_search_query(); ?>"</h3>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.