Make WordPress Core

Changeset 21279


Ignore:
Timestamp:
07/18/2012 06:13:49 PM (12 years ago)
Author:
lancewillett
Message:

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.

Location:
trunk/wp-content/themes/twentytwelve
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-content/themes/twentytwelve/functions.php

    r21278 r21279  
    327327/**
    328328 * Extends the default WordPress body class to denote a full-width layout.
    329  *
    330  * Used in two cases: no active widgets in sidebar, and full-width page template.
     329 * Used when there are no active widgets in the sidebar.
    331330 *
    332331 * @since Twenty Twelve 1.0
     
    341340
    342341/**
    343  * Adjust $content width for full-width and single image attachment templates.
     342 * Adjust $content width for full-width and single image attachment templates
     343 * and when there are no active widgets in the sidebar.
     344 *
     345 * @since Twenty Twelve 1.0
    344346 */
    345347function twentytwelve_content_width() {
    346     if ( is_page_template( 'full-width-page.php' ) || is_attachment() ) {
     348    if ( is_page_template( 'full-width-page.php' ) || is_attachment() || ! is_active_sidebar( 'sidebar-1' ) ) {
    347349        global $content_width;
    348350        $content_width = 960;
  • trunk/wp-content/themes/twentytwelve/style.css

    r21277 r21279  
    488488    body.page-template-full-width-page-php #primary,
    489489    body.page-template-homepage-php #primary,
    490     body.single-attachment #primary {
     490    body.single-attachment #primary,
     491    body.full-width #primary {
    491492        width: 100%;
    492493    }
Note: See TracChangeset for help on using the changeset viewer.