wordpress snippets last updated   : August 18, 2014
we now have 638 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 →

Did you like this post? If so please share it with your friends. Thanks!

jqsnipp.com | we just launched jquery snippets website