From 95828541227130951f264c90f3b47f02690cacb5 Mon Sep 17 00:00:00 2001 From: lancewillett Date: Wed, 18 Jul 2012 18:13:49 +0000 Subject: [PATCH] Twenty Twelve: Update full-width handling with a missing CSS selector, and add case of no sidebar to the content_width calculation. Props obenland, fixes #21254. git-svn-id: http://core.svn.wordpress.org/trunk@21279 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-content/themes/twentytwelve/functions.php | 10 ++++++---- wp-content/themes/twentytwelve/style.css | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/wp-content/themes/twentytwelve/functions.php b/wp-content/themes/twentytwelve/functions.php index 5b43295e34..ba24ceb6be 100644 --- a/wp-content/themes/twentytwelve/functions.php +++ b/wp-content/themes/twentytwelve/functions.php @@ -326,8 +326,7 @@ endif; /** * Extends the default WordPress body class to denote a full-width layout. - * - * Used in two cases: no active widgets in sidebar, and full-width page template. + * Used when there are no active widgets in the sidebar. * * @since Twenty Twelve 1.0 */ @@ -340,10 +339,13 @@ function twentytwelve_body_class( $classes ) { add_filter( 'body_class', 'twentytwelve_body_class' ); /** - * Adjust $content width for full-width and single image attachment templates. + * Adjust $content width for full-width and single image attachment templates + * and when there are no active widgets in the sidebar. + * + * @since Twenty Twelve 1.0 */ function twentytwelve_content_width() { - if ( is_page_template( 'full-width-page.php' ) || is_attachment() ) { + if ( is_page_template( 'full-width-page.php' ) || is_attachment() || ! is_active_sidebar( 'sidebar-1' ) ) { global $content_width; $content_width = 960; } diff --git a/wp-content/themes/twentytwelve/style.css b/wp-content/themes/twentytwelve/style.css index 58adab36ad..e2445aa89e 100644 --- a/wp-content/themes/twentytwelve/style.css +++ b/wp-content/themes/twentytwelve/style.css @@ -487,7 +487,8 @@ a:hover { @media screen and (min-width: 600px) { body.page-template-full-width-page-php #primary, body.page-template-homepage-php #primary, - body.single-attachment #primary { + body.single-attachment #primary, + body.full-width #primary { width: 100%; } }