wordpress snippets last updated   : April 14, 2014
we now have 630 snippets

Show search query in search box and query in results page

wordpress snippet

Adding these snippets to your search template will display the search query on the results page and the search query within the search box on the results page.

snippet :  PHP - results in search boxcopy
<form method="get" id="searchform" action="<?php bloginfo('url'); ?>/">
  <div>
    <input type="text" value="<?php the_search_query(); ?>" name="s" id="s" />
    <input type="submit" id="searchsubmit" value="Search" />
  </div>
</form>
source →
snippet :  PHP - results querycopy
<p>You searched for " <?php the_search_query() ?> ". Here are the results:</p>
source →
jqsnipp.com | we just launched jquery snippets website