forked from WPBuddy/largo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
searchform.php
34 lines (29 loc) · 1.03 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
*/
if ( of_get_option('use_gcs') && of_get_option('gcs_id') ) :
?>
<div class="gcs_container">
<script>
(function() {
var cx = '<?php echo of_get_option('gcs_id'); ?>';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
'//www.google.com/cse/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
})();
</script>
<gcse:search></gcse:search>
</div>
<?php else: ?>
<form class="form-search" role="search" method="get" action="<?php echo esc_url( home_url( '/' ) ); ?>">
<div>
<input type="text" placeholder="<?php _e('Search', 'largo'); ?>" class="searchbox search-query" value="" name="s" />
<input type="submit" value="<?php _e('GO', 'largo'); ?>" name="search submit" class="search-submit btn">
</div>
</form>
<?php endif; ?>