[wp-trac] [WordPress Trac] #20435: Search result body classes not always applied
WordPress Trac
wp-trac at lists.automattic.com
Fri Apr 13 15:05:22 UTC 2012
#20435: Search result body classes not always applied
--------------------------+-----------------------------
Reporter: johnbillion | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Template | Version:
Severity: normal | Keywords:
--------------------------+-----------------------------
On search results pages a body class of 'search' is applied. This is
correctly applied when `is_search()` is true.
A body class of 'search-results' and 'search-no-results' is also applied
according to whether or not there are any results.
However, these two body classes are applied in an `else` block after a
check for `is_archive()`, so this means if you filter your search results
by post type (eg. `s=my_search_term&post_type=my_post_type`) then the
'search-results' and 'search-no-results' body classes are not applied
because `is_archive()` is true.
Patch coming up.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/20435>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list