Merge pull request #822 from Foxaii/search-fix-3.6
Search form support for WordPress 3.6+
This commit is contained in:
@@ -256,11 +256,11 @@ function roots_request_filter($query_vars) {
|
||||
add_filter('request', 'roots_request_filter');
|
||||
|
||||
/**
|
||||
* Tell WordPress to use searchform.php from the templates/ directory
|
||||
* Tell WordPress to use searchform.php from the templates/ directory. Requires WordPress 3.6+
|
||||
*/
|
||||
function roots_get_search_form($argument) {
|
||||
if ($argument === '') {
|
||||
locate_template('/templates/searchform.php', true, false);
|
||||
}
|
||||
function roots_get_search_form($form) {
|
||||
$form = '';
|
||||
locate_template('/templates/searchform.php', true, false);
|
||||
return $form;
|
||||
}
|
||||
add_filter('get_search_form', 'roots_get_search_form');
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
<time class="updated" datetime="<?php echo get_the_time('c'); ?>" pubdate><?php echo get_the_date(); ?></time>
|
||||
<time class="published" datetime="<?php echo get_the_time('c'); ?>"><?php echo get_the_date(); ?></time>
|
||||
<p class="byline author vcard"><?php echo __('By', 'roots'); ?> <a href="<?php echo get_author_posts_url(get_the_author_meta('ID')); ?>" rel="author" class="fn"><?php echo get_the_author(); ?></a></p>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<form role="search" method="get" id="searchform" class="form-inline" action="<?php echo home_url('/'); ?>">
|
||||
<form role="search" method="get" class="search-form form-inline" action="<?php echo home_url('/'); ?>">
|
||||
<div class="input-group">
|
||||
<input type="search" value="<?php if (is_search()) { echo get_search_query(); } ?>" name="s" id="s" class="form-control" placeholder="<?php _e('Search', 'roots'); ?> <?php bloginfo('name'); ?>">
|
||||
<label class="hide" for="s"><?php _e('Search for:', 'roots'); ?></label>
|
||||
<input type="search" value="<?php if (is_search()) { echo get_search_query(); } ?>" name="s" class="search-field form-control" placeholder="<?php _e('Search', 'roots'); ?> <?php bloginfo('name'); ?>">
|
||||
<label class="hide"><?php _e('Search for:', 'roots'); ?></label>
|
||||
<span class="input-group-btn">
|
||||
<button type="submit" id="searchsubmit" class="btn btn-default"><?php _e('Search', 'roots'); ?></button>
|
||||
<button type="submit" class="search-submit btn btn-default"><?php _e('Search', 'roots'); ?></button>
|
||||
</span>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user