Close #638 - Add add_theme_support for Nice Search

This commit is contained in:
Ben Word
2013-01-27 20:42:40 -06:00
parent edfb82618a
commit 433ad26e4d
4 changed files with 6 additions and 1 deletions

View File

@@ -1,4 +1,5 @@
### HEAD ### HEAD
* Enable `add_theme_support` for Nice Search
* Replace ID's with classes * Replace ID's with classes
* Add support for dynamic sidebar templates * Add support for dynamic sidebar templates
* Fix PHP notice on search with no results * Fix PHP notice on search with no results

View File

@@ -23,6 +23,7 @@ This file is used to enable various theme features, define which pages get the s
2. [Rewrites](rewrites.md) 2. [Rewrites](rewrites.md)
3. HTML5 Boilerplate's `.htaccess` 3. HTML5 Boilerplate's `.htaccess`
4. Bootstrap's top navbar 4. Bootstrap's top navbar
5. Nice Search (redirect `/?s=` to `/search/`)
If you don't want to use one of the features, either comment out the line or remove it. If you don't want to use one of the features, either comment out the line or remove it.

View File

@@ -488,7 +488,9 @@ function roots_nice_search_redirect() {
} }
} }
add_action('template_redirect', 'roots_nice_search_redirect'); if (current_theme_supports('nice-search')) {
add_action('template_redirect', 'roots_nice_search_redirect');
}
/** /**
* Fix for empty search queries redirecting to home page * Fix for empty search queries redirecting to home page

View File

@@ -8,6 +8,7 @@ add_theme_support('root-relative-urls'); // Enable relative URLs
add_theme_support('rewrite-urls'); // Enable URL rewrites add_theme_support('rewrite-urls'); // Enable URL rewrites
add_theme_support('h5bp-htaccess'); // Enable HTML5 Boilerplate's .htaccess add_theme_support('h5bp-htaccess'); // Enable HTML5 Boilerplate's .htaccess
add_theme_support('bootstrap-top-navbar'); // Enable Bootstrap's fixed navbar add_theme_support('bootstrap-top-navbar'); // Enable Bootstrap's fixed navbar
add_theme_support('nice-search'); // Enable /?s= to /search/ redirect
/** /**