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
This commit is contained in:
lancewillett 2012-07-18 18:13:49 +00:00
parent e57205a236
commit f16fc0c431
2 changed files with 8 additions and 5 deletions

View File

@ -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;
}

View File

@ -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%;
}
}