I was mucking around in search.php playing with the results shown as well as following some tutorials. I dissected a small function that displays the amount of results and what was input here is what i got. <?php /* Search Count */ $allsearch = &new WP_Query("s=$s&showposts=-1"); $key = wp_specialchars($s, 1); $count = $allsearch->post_count; echo $count . ' '; _e('Articles'); wp_reset_query(); ?> Found for "<?php echo $s; ?>" PHP: Does the part that counts the amount of posts found have any unnecessary code inside it that I may need to delete? Thanks in advance
Don't forget to escape $s; <?php $s = htmlspecialchars($_GET['s']); /* Search Count */ $allsearch = &new WP_Query("s=$s&showposts=-1"); // for what? // $key = wp_specialchars($s, 1); $count = $allsearch->post_count; echo $count." "; _e('Articles'); wp_reset_query(); ?> Found for "<?php echo $s; ?>" PHP: