Permalink
Browse files

Merge pull request #593 from clarkbw/search_value_preserved

Preserve the search query in the search input
  • Loading branch information...
2 parents 18dadde + eca7244 commit 68e2a613be7e4c9f31ab3bae63c86d3fae57b1ce @retlehs retlehs committed Dec 6, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 templates/searchform.php
@@ -1,5 +1,5 @@
<form role="search" method="get" id="searchform" class="form-search" action="<?php echo home_url('/'); ?>">
<label class="hide" for="s"><?php _e('Search for:', 'roots'); ?></label>
- <input type="text" value="" name="s" id="s" class="search-query" placeholder="<?php _e('Search', 'roots'); ?> <?php bloginfo('name'); ?>">
+ <input type="text" value="<?php if (is_search()) { echo get_search_query(); } ?>" name="s" id="s" class="search-query" placeholder="<?php _e('Search', 'roots'); ?> <?php bloginfo('name'); ?>">
<input type="submit" id="searchsubmit" value="<?php _e('Search', 'roots'); ?>" class="btn">
</form>

0 comments on commit 68e2a61

Please sign in to comment.