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: https://develop.svn.wordpress.org/trunk@21279 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
4686ae30de
commit
8dc9cd8698
@ -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;
|
||||
}
|
||||
|
@ -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%;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user