forked from swashata/ipt-knowledgebase-theme-wp
-
Notifications
You must be signed in to change notification settings - Fork 1
/
searchform.php
21 lines (21 loc) · 1.04 KB
/
searchform.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
/**
* The template for displaying search forms in iPanelThemes Knowledgebase
*
* @package iPanelThemes Knowledgebase
*/
$stext = esc_attr_x( 'Search Knowledgebase…', 'placeholder', 'ipt_kb' );
?>
<form role="search" method="get" class="search-form" action="<?php echo esc_url( home_url( '/' ) ); ?>">
<?php // Check to see if category, if yes, then modify the search parameters ?>
<?php if ( is_category() ) : ?>
<input type="hidden" name="cat" value="<?php echo esc_attr( get_query_var( 'cat' ) ); ?>" />
<?php $stext = esc_attr( sprintf( __( 'Search Knowledgebase for %s…', 'ipt_kb' ), single_cat_title( '', false ) ) ); ?>
<?php endif; ?>
<div class="form-group">
<div class="input-group input-group-lg">
<input type="search" class="search-field form-control" placeholder="<?php echo $stext; ?>" value="<?php echo esc_attr( get_search_query() ); ?>" name="s" />
<span class="input-group-btn"><button type="submit" class="btn btn-default"><span class="ipt-icomoon-search"></span></button></span>
</div>
</div>
</form>