From 83bcbc997bc85465e52cc3ffb887cda2f612d818 Mon Sep 17 00:00:00 2001 From: Lance Willett Date: Tue, 28 Aug 2012 17:16:18 +0000 Subject: [PATCH] Twenty Twelve: use sidebar ID string value for sidebar checks instead of hard-coded integer, props nacin. See #21685. git-svn-id: http://core.svn.wordpress.org/trunk@21643 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- functions.php | 6 +++--- sidebar-home.php | 10 +++++----- sidebar.php | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/functions.php b/functions.php index 66d677afb..649f47823 100644 --- a/functions.php +++ b/functions.php @@ -211,7 +211,7 @@ add_action( 'widgets_init', 'twentytwelve_widgets_init' ); function twentytwelve_homepage_sidebar_class() { $classes = array( 'widget-area' ); - if ( is_active_sidebar( 2 ) && is_active_sidebar( 3 ) ) + if ( is_active_sidebar( 'sidebar-2' ) && is_active_sidebar( 'sidebar-3' ) ) $classes[] = 'two'; echo 'class="' . implode( ' ', $classes ) . '"'; @@ -362,7 +362,7 @@ endif; function twentytwelve_body_class( $classes ) { $background_color = get_background_color(); - if ( ! is_active_sidebar( 1 ) || is_page_template( 'page-templates/full-width.php' ) ) + if ( ! is_active_sidebar( 'sidebar-1' ) || is_page_template( 'page-templates/full-width.php' ) ) $classes[] = 'full-width'; if ( is_page_template( 'page-templates/home.php' ) ) { @@ -387,7 +387,7 @@ add_filter( 'body_class', 'twentytwelve_body_class' ); * @since Twenty Twelve 1.0 */ function twentytwelve_content_width() { - if ( is_page_template( 'page-templates/full-width.php' ) || is_attachment() || ! is_active_sidebar( 1 ) ) { + if ( is_page_template( 'page-templates/full-width.php' ) || is_attachment() || ! is_active_sidebar( 'sidebar-1' ) ) { global $content_width; $content_width = 960; } diff --git a/sidebar-home.php b/sidebar-home.php index 4629c9c2a..56aad5d0a 100644 --- a/sidebar-home.php +++ b/sidebar-home.php @@ -15,21 +15,21 @@ * * If none of the sidebars have widgets, then let's bail early. */ -if ( ! is_active_sidebar( 2 ) && ! is_active_sidebar( 3 ) ) +if ( ! is_active_sidebar( 'sidebar-2' ) && ! is_active_sidebar( 'sidebar-3' ) ) return; // If we get this far, we have widgets. Let do this. ?>
role="complementary"> - +
- +
- +
- +
\ No newline at end of file diff --git a/sidebar.php b/sidebar.php index 151fbc44f..2bc4969ae 100644 --- a/sidebar.php +++ b/sidebar.php @@ -10,8 +10,8 @@ */ ?> - + \ No newline at end of file