Last active
December 28, 2015 17:59
-
-
Save mattkelley/7539945 to your computer and use it in GitHub Desktop.
A lean, and simple WordPress search form.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Set placeholder value | |
$placeholder = is_search() ? esc_attr(get_search_query()) : esc_attr_e('Search', 'firewood'); ?> | |
<form method="get" action="<?php echo trailingslashit(home_url()); ?>"> | |
<input type="search" name="search" placeholder="<?php echo $placeholder; ?>" /> | |
<input type="submit" name="submit" value="<?php esc_attr_e('Search', 'firewood'); ?>" /> | |
</form><!-- / form --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment