Always show search-results or search-no-results for searches, even archive searches. Props johnbillion. fixes #20435
git-svn-id: http://svn.automattic.com/wordpress/trunk@20595 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
25ec571dae
commit
54a1ee90b9
|
@ -411,8 +411,10 @@ function get_body_class( $class = '' ) {
|
|||
$classes[] = 'archive';
|
||||
if ( is_date() )
|
||||
$classes[] = 'date';
|
||||
if ( is_search() )
|
||||
if ( is_search() ) {
|
||||
$classes[] = 'search';
|
||||
$classes[] = $wp_query->posts ? 'search-results' : 'search-no-results';
|
||||
}
|
||||
if ( is_paged() )
|
||||
$classes[] = 'paged';
|
||||
if ( is_attachment() )
|
||||
|
@ -491,11 +493,6 @@ function get_body_class( $class = '' ) {
|
|||
} else {
|
||||
$classes[] = 'page-template-default';
|
||||
}
|
||||
} elseif ( is_search() ) {
|
||||
if ( !empty( $wp_query->posts ) )
|
||||
$classes[] = 'search-results';
|
||||
else
|
||||
$classes[] = 'search-no-results';
|
||||
}
|
||||
|
||||
if ( is_user_logged_in() )
|
||||
|
|
Loading…
Reference in New Issue