Make WordPress Core

Changeset 21643


Ignore:
Timestamp:
08/28/2012 05:16:18 PM (14 years ago)
Author:
lancewillett
Message:

Twenty Twelve: use sidebar ID string value for sidebar checks instead of hard-coded integer, props nacin. See #21685.

Location:
trunk/wp-content/themes/twentytwelve
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-content/themes/twentytwelve/functions.php

    r21642 r21643  
    212212        $classes = array( 'widget-area' );
    213213
    214         if ( is_active_sidebar( 2 ) && is_active_sidebar( 3 ) )
     214        if ( is_active_sidebar( 'sidebar-2' ) && is_active_sidebar( 'sidebar-3' ) )
    215215                $classes[] = 'two';
    216216
    … …  
    363363        $background_color = get_background_color();
    364364
    365         if ( ! is_active_sidebar( 1 ) || is_page_template( 'page-templates/full-width.php' ) )
     365        if ( ! is_active_sidebar( 'sidebar-1' ) || is_page_template( 'page-templates/full-width.php' ) )
    366366                $classes[] = 'full-width';
    367367
    … …  
    388388 */
    389389function twentytwelve_content_width() {
    390         if ( is_page_template( 'page-templates/full-width.php' ) || is_attachment() || ! is_active_sidebar( 1 ) ) {
     390        if ( is_page_template( 'page-templates/full-width.php' ) || is_attachment() || ! is_active_sidebar( 'sidebar-1' ) ) {
    391391                global $content_width;
    392392                $content_width = 960;
  • trunk/wp-content/themes/twentytwelve/sidebar-home.php

    r21620 r21643  
    1616 * If none of the sidebars have widgets, then let's bail early.
    1717 */
    18 if ( ! is_active_sidebar( 2 ) && ! is_active_sidebar( 3 ) )
     18if ( ! is_active_sidebar( 'sidebar-2' ) && ! is_active_sidebar( 'sidebar-3' ) )
    1919        return;
    2020
    … …  
    2222?>
    2323<div id="secondary" <?php twentytwelve_homepage_sidebar_class(); ?> role="complementary">
    24         <?php if ( is_active_sidebar( 2 ) ) : ?>
     24        <?php if ( is_active_sidebar( 'sidebar-2' ) ) : ?>
    2525        <div class="first home-widgets">
    26                 <?php dynamic_sidebar( 2 ); ?>
     26                <?php dynamic_sidebar( 'sidebar-2' ); ?>
    2727        </div><!-- .first -->
    2828        <?php endif; ?>
    2929
    30         <?php if ( is_active_sidebar( 3 ) ) : ?>
     30        <?php if ( is_active_sidebar( 'sidebar-3' ) ) : ?>
    3131        <div class="second home-widgets">
    32                 <?php dynamic_sidebar( 3 ); ?>
     32                <?php dynamic_sidebar( 'sidebar-3' ); ?>
    3333        </div><!-- .second -->
    3434        <?php endif; ?>
  • trunk/wp-content/themes/twentytwelve/sidebar.php

    r21620 r21643  
    1111?>
    1212
    13         <?php if ( is_active_sidebar( 1 ) ) : ?>
     13        <?php if ( is_active_sidebar( 'sidebar-1' ) ) : ?>
    1414                <div id="secondary" class="widget-area" role="complementary">
    15                         <?php dynamic_sidebar( 1 ); ?>
     15                        <?php dynamic_sidebar( 'sidebar-1' ); ?>
    1616                </div><!-- #secondary -->
    1717        <?php endif; ?>
Note: See TracChangeset for help on using the changeset viewer.