Making WordPress.org

Changeset 1493


Ignore:
Timestamp:
04/21/2015 07:21:25 PM (10 years ago)
Author:
obenland
Message:

WP.org Themes: Use body class for empty results.

Fixes a bug where the .no-results class was not removed after navigating away
from the empty result.

Location:
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/functions.php

    r1489 r1493  
    8787 * 1. denote singular themes.
    8888 * 2. Identify IE8.
     89 * 3. denote if no themes were found.
    8990 *
    9091 * @param array $classes A list of existing body class values.
     
    99100    if ( $GLOBALS['is_IE'] && false !== strpos( $_SERVER['HTTP_USER_AGENT'], 'MSIE 8' ) ) {
    100101        $classes[] = 'ie8';
     102    }
     103
     104    if ( ! $GLOBALS['themes']['themes'] ) {
     105        $classes[] = 'no-results';
    101106    }
    102107
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/header.php

    r1489 r1493  
    66 */
    77
     8$GLOBALS['themes']    = wporg_themes_get_themes_for_query();
    89$GLOBALS['pagetitle'] = __( 'Theme Directory « Free WordPress Themes', 'wporg-themes' );
    910
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/index.php

    r1489 r1493  
    1212 */
    1313
    14 $themes = wporg_themes_get_themes_for_query();
     14global $themes;
    1515
    1616if ( ! function_exists( 'get_theme_feature_list' ) ) {
     
    6363        </div><!-- .wp-filter -->
    6464
    65         <div class="theme-browser content-filterable <?php if ( ! $themes['themes'] ) { echo 'no-results'; } ?>">
     65        <div class="theme-browser content-filterable">
    6666            <div class="themes">
    6767                <?php
     
    8686                ?>
    8787            </div>
    88            
     88
    8989            <p class="no-themes"><?php _e( 'No themes found. Try a different search.', 'wporg-themes' ); ?></p>
    9090        </div>
Note: See TracChangeset for help on using the changeset viewer.