From 54a1ee90b9663510a8d64c0c113e91e6f0e307c8 Mon Sep 17 00:00:00 2001 From: ryan 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: http://svn.automattic.com/wordpress/trunk@20595 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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() )