Ticket #21254: 21254.diff
| File 21254.diff, 2.0 KB (added by obenland, 10 months ago) |
|---|
-
wp-content/themes/twentytwelve/style.css
471 471 @media screen and (min-width: 600px) { 472 472 body.page-template-full-width-page-php #primary, 473 473 body.page-template-homepage-php #primary, 474 body.single-attachment #primary { 474 body.single-attachment #primary, 475 body.full-width #primary { 475 476 width: 100%; 476 477 } 477 478 } -
wp-content/themes/twentytwelve/functions.php
302 302 /** 303 303 * Extends the default WordPress body class to denote a full-width layout. 304 304 * 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. 306 306 * 307 307 * @since Twenty Twelve 1.0 308 308 */ 309 309 function twentytwelve_body_class( $classes ) { 310 if ( ! is_active_sidebar( 'sidebar-1' ) || is_page_template( 'full-width' ))310 if ( ! is_active_sidebar( 'sidebar-1' ) ) 311 311 $classes[] = 'full-width'; 312 312 313 313 return $classes; … … 315 315 add_filter( 'body_class', 'twentytwelve_body_class' ); 316 316 317 317 /** 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 319 322 */ 320 323 function 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' ) ) { 322 325 global $content_width; 323 326 $content_width = 960; 324 327 } 325 328 } 326 add_action( 'template_redirect', 'twentytwelve_content_width' ); 329 add_action( 'template_redirect', 'twentytwelve_content_width' ); 330 No newline at end of file
