Use Sass to style search form, remove search template
This commit is contained in:
@@ -0,0 +1,15 @@
|
|||||||
|
// Search form
|
||||||
|
.search-form {
|
||||||
|
@extend .form-inline;
|
||||||
|
}
|
||||||
|
.search-form label {
|
||||||
|
font-weight: normal;
|
||||||
|
@extend .form-group;
|
||||||
|
}
|
||||||
|
.search-form .search-field {
|
||||||
|
@extend .form-control;
|
||||||
|
}
|
||||||
|
.search-form .search-submit {
|
||||||
|
@extend .btn;
|
||||||
|
@extend .btn-default;
|
||||||
|
}
|
||||||
|
|||||||
@@ -10,7 +10,6 @@
|
|||||||
* @link https://github.com/roots/sage/pull/1042
|
* @link https://github.com/roots/sage/pull/1042
|
||||||
*/
|
*/
|
||||||
$sage_includes = [
|
$sage_includes = [
|
||||||
'lib/utils.php', // Utility functions
|
|
||||||
'lib/init.php', // Initial theme setup and constants
|
'lib/init.php', // Initial theme setup and constants
|
||||||
'lib/wrapper.php', // Theme wrapper class
|
'lib/wrapper.php', // Theme wrapper class
|
||||||
'lib/config.php', // Configuration
|
'lib/config.php', // Configuration
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ function setup() {
|
|||||||
|
|
||||||
// Add HTML5 markup for captions
|
// Add HTML5 markup for captions
|
||||||
// http://codex.wordpress.org/Function_Reference/add_theme_support#HTML5
|
// http://codex.wordpress.org/Function_Reference/add_theme_support#HTML5
|
||||||
add_theme_support('html5', ['caption', 'comment-form', 'comment-list', 'gallery']);
|
add_theme_support('html5', ['caption', 'comment-form', 'comment-list', 'gallery', 'search-form']);
|
||||||
|
|
||||||
// Tell the TinyMCE editor to use a custom stylesheet
|
// Tell the TinyMCE editor to use a custom stylesheet
|
||||||
add_editor_style(Assets\asset_path('styles/editor-style.css'));
|
add_editor_style(Assets\asset_path('styles/editor-style.css'));
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace Roots\Sage\Utils;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Tell WordPress to use searchform.php from the templates/ directory
|
|
||||||
*/
|
|
||||||
function get_search_form() {
|
|
||||||
$form = '';
|
|
||||||
locate_template('/templates/searchform.php', true, false);
|
|
||||||
return $form;
|
|
||||||
}
|
|
||||||
add_filter('get_search_form', __NAMESPACE__ . '\\get_search_form');
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
<form role="search" method="get" class="search-form form-inline" action="<?= esc_url(home_url('/')); ?>">
|
|
||||||
<label class="sr-only"><?php _e('Search for:', 'sage'); ?></label>
|
|
||||||
<div class="input-group">
|
|
||||||
<input type="search" value="<?= get_search_query(); ?>" name="s" class="search-field form-control" placeholder="<?php _e('Search', 'sage'); ?> <?php bloginfo('name'); ?>" required>
|
|
||||||
<span class="input-group-btn">
|
|
||||||
<button type="submit" class="search-submit btn btn-default"><?php _e('Search', 'sage'); ?></button>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
Reference in New Issue
Block a user