From 577286e19d176ce9ce4ee48e6ccfa884df11a3b0 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Wed, 25 Apr 2012 20:38:40 +0000 Subject: [PATCH] Always show search-results or search-no-results for searches, even archive searches. Props johnbillion. fixes #20435 git-svn-id: https://develop.svn.wordpress.org/trunk@20595 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/post-template.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php index 7a60672d25..1cbf2539eb 100644 --- a/wp-includes/post-template.php +++ b/wp-includes/post-template.php @@ -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() )