Ticket #21254: 21254.diff

File 21254.diff, 2.0 KB (added by obenland, 10 months ago)
  • wp-content/themes/twentytwelve/style.css

     
    471471@media screen and (min-width: 600px) { 
    472472        body.page-template-full-width-page-php #primary, 
    473473        body.page-template-homepage-php #primary, 
    474         body.single-attachment #primary { 
     474        body.single-attachment #primary, 
     475        body.full-width #primary { 
    475476                width: 100%; 
    476477        } 
    477478} 
  • wp-content/themes/twentytwelve/functions.php

     
    302302/** 
    303303 * Extends the default WordPress body class to denote a full-width layout. 
    304304 * 
    305  * Used in two cases: no active widgets in sidebar, and full-width page template. 
     305 * Used when there are no active widgets in the sidebar. 
    306306 * 
    307307 * @since Twenty Twelve 1.0 
    308308 */ 
    309309function twentytwelve_body_class( $classes ) { 
    310         if ( ! is_active_sidebar( 'sidebar-1' ) || is_page_template( 'full-width' ) ) 
     310        if ( ! is_active_sidebar( 'sidebar-1' ) ) 
    311311                $classes[] = 'full-width'; 
    312312 
    313313        return $classes; 
     
    315315add_filter( 'body_class', 'twentytwelve_body_class' ); 
    316316 
    317317/** 
    318  * Adjust $content width for full-width and single image attachment templates. 
     318 * Adjust $content width for full-width and single image attachment templates 
     319 * and when there are no active widgets in the sidebar. 
     320 *  
     321 * @since Twenty Twelve 1.0 
    319322 */ 
    320323function twentytwelve_content_width() { 
    321         if ( is_page_template( 'full-width-page.php' ) || is_attachment() ) { 
     324        if ( is_page_template( 'full-width-page.php' ) || is_attachment() || ! is_active_sidebar( 'sidebar-1' ) ) { 
    322325                global $content_width; 
    323326                $content_width = 960; 
    324327        } 
    325328} 
    326 add_action( 'template_redirect', 'twentytwelve_content_width' ); 
     329add_action( 'template_redirect', 'twentytwelve_content_width' ); 
     330 No newline at end of file