Wordpress Search Results Number

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

Add this in search.php

Copy this code and paste it in your HTML
  1. <h2 class="pagetitle">Search Results for <?php /* Search Count */ $allsearch = &new WP_Query("s=$s&showposts=-1"); $key = wp_specialchars($s, 1); $count = $allsearch->post_count; _e(''); _e('<span class="search-terms">'); echo $key; _e('</span>'); _e(' — '); echo $count . ' '; _e('articles'); wp_reset_query(); ?></h2>

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.