Make WordPress Core

Changeset 20595


Ignore:
Timestamp:
04/25/2012 08:38:40 PM (13 years ago)
Author:
ryan
Message:

Always show search-results or search-no-results for searches, even archive searches. Props johnbillion. fixes #20435

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/post-template.php

    r20075 r20595  
    412412    if ( is_date() )
    413413        $classes[] = 'date';
    414     if ( is_search() )
     414    if ( is_search() ) {
    415415        $classes[] = 'search';
     416        $classes[] = $wp_query->posts ? 'search-results' : 'search-no-results';
     417    }
    416418    if ( is_paged() )
    417419        $classes[] = 'paged';
     
    492494            $classes[] = 'page-template-default';
    493495        }
    494     } elseif ( is_search() ) {
    495         if ( !empty( $wp_query->posts ) )
    496             $classes[] = 'search-results';
    497         else
    498             $classes[] = 'search-no-results';
    499496    }
    500497
Note: See TracChangeset for help on using the changeset viewer.