Make WordPress Core

Ticket #21685: 21685-sidebars.diff

File 21685-sidebars.diff, 3.0 KB (added by obenland, 14 years ago)
  • wp-content/themes/twentytwelve/functions.php

     
    368368function twentytwelve_body_class( $classes ) {
    369369        $background_color = get_background_color();
    370370
    371         if ( ! is_active_sidebar( 'sidebar-1' ) || is_page_template( 'full-width-page.php' ) )
     371        if ( ! is_active_sidebar( 1 ) || is_page_template( 'full-width-page.php' ) )
    372372                $classes[] = 'full-width';
    373373
    374374        if ( is_page_template( 'homepage.php' ) && has_post_thumbnail() )
     
    390390 * @since Twenty Twelve 1.0
    391391 */
    392392function twentytwelve_content_width() {
    393         if ( is_page_template( 'full-width-page.php' ) || is_attachment() || ! is_active_sidebar( 'sidebar-1' ) ) {
     393        if ( is_page_template( 'full-width-page.php' ) || is_attachment() || ! is_active_sidebar( 1 ) ) {
    394394                global $content_width;
    395395                $content_width = 960;
    396396        }
  • wp-content/themes/twentytwelve/sidebar.php

     
    88 * @subpackage Twenty_Twelve
    99 * @since Twenty Twelve 1.0
    1010 */
    11 ?>
    1211
    13         <?php if ( is_active_sidebar( 'sidebar-1' ) ) : ?>
    14                 <div id="secondary" class="widget-area" role="complementary">
    15                         <?php dynamic_sidebar( 'sidebar-1' ); ?>
    16                 </div><!-- #secondary .widget-area -->
    17         <?php endif; ?>
    18  No newline at end of file
     12if ( is_active_sidebar( 1 ) ) : ?>
     13        <div id="secondary" class="widget-area" role="complementary">
     14                <?php dynamic_sidebar( 1 ); ?>
     15        </div><!-- #secondary .widget-area -->
     16<?php endif; ?>
  • wp-content/themes/twentytwelve/sidebar-home.php

     
    1010 */
    1111
    1212/*
    13 The homepage widget area is triggered if any of the areas
    14 have widgets. So let's check that first.
    15 
    16 If none of the sidebars have widgets, then let's bail early.
    17 */
     13 * The homepage widget area is triggered if any of the areas
     14 * have widgets. So let's check that first.
     15 *
     16 * If none of the sidebars have widgets, then let's bail early.
     17 */
    1818if ( ! is_active_sidebar( 2 ) && ! is_active_sidebar( 3 ) )
    1919        return;
    2020
     
    2323<div id="secondary" <?php twentytwelve_homepage_sidebar_class(); ?> role="complementary">
    2424        <?php if ( is_active_sidebar( 2 ) ) : ?>
    2525        <div class="first home-widgets">
    26                 <?php dynamic_sidebar( 'sidebar-2' ); ?>
     26                <?php dynamic_sidebar( 2 ); ?>
    2727        </div><!-- .first .home-widgets -->
    2828        <?php endif; ?>
    2929
    3030        <?php if ( is_active_sidebar( 3 ) ) : ?>
    3131        <div class="second home-widgets">
    32                 <?php dynamic_sidebar( 'sidebar-3' ); ?>
     32                <?php dynamic_sidebar( 3 ); ?>
    3333        </div><!-- .second .home-widgets -->
    3434        <?php endif; ?>
    3535</div><!-- #secondary .widget-area -->
     36 No newline at end of file