-
Notifications
You must be signed in to change notification settings - Fork 3
/
searchform.php
34 lines (28 loc) · 1.08 KB
/
searchform.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
/**
* The template for displaying search forms in LSX.
*
* @package lsx
*/
$style = 'body #searchform { display: block; }';
if ( is_customize_preview() ) {
$search_form = get_theme_mod( 'lsx_header_search', false );
if ( false === $search_form ) {
$style = 'body #searchform { display: none; }';
}
}
?>
<form role="search" method="get" class="search-form form-inline" id="searchform" action="<?php echo esc_url( home_url( '/' ) ); ?>">
<div class="input-group">
<input type="search" value="<?php if ( is_search() ) { echo get_search_query(); } ?>" name="s" class="search-field form-control" placeholder="<?php esc_attr_e( 'Search', 'lsx' ); ?> <?php echo esc_attr( get_bloginfo( 'name' ) ); ?>">
<label class="hide"><?php esc_html_e( 'Search for:', 'lsx' ); ?></label>
<span class="input-group-btn">
<button type="submit" class="search-submit btn btn-default"><span class="fa fa-search"></span></button>
</span>
</div>
<?php if ( is_customize_preview() ) : ?>
<style id="lsx-header-search-css">
<?php echo esc_attr( $style ); ?>
</style>
<?php endif; ?>
</form>