Changeset 21325
- Timestamp:
- 07/25/2012 04:28:50 PM (12 years ago)
- Location:
- trunk/wp-content/themes/twentytwelve
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-content/themes/twentytwelve/functions.php
r21279 r21325 72 72 73 73 // Add support for custom background. 74 add_theme_support( 'custom-background' ); 74 add_theme_support( 'custom-background', array( 75 'default-color' => 'e6e6e6', 76 ) ); 75 77 76 78 // Add custom image size for featured image use, displayed on "standard" posts. … … 326 328 327 329 /** 328 * Extends the default WordPress body class to denote a full-width layout. 329 * Used when there are no active widgets in the sidebar. 330 * Extends the default WordPress body class to denote: 331 * 1. Using a full-width layout, when no active widgets in the sidebar 332 * or full-width template. 333 * 2. White or empty background color to change the layout and spacing. 330 334 * 331 335 * @since Twenty Twelve 1.0 332 336 */ 333 337 function twentytwelve_body_class( $classes ) { 334 if ( ! is_active_sidebar( 'sidebar-1' ) || is_page_template( 'full-width' ) ) 338 $background_color = get_background_color(); 339 340 if ( ! is_active_sidebar( 'sidebar-1' ) || is_page_template( 'full-width-page.php' ) ) 335 341 $classes[] = 'full-width'; 342 343 if ( empty( $background_color ) ) 344 $classes[] = 'custom-background-empty'; 345 elseif ( in_array( $background_color, array( 'fff', 'ffffff' ) ) ) 346 $classes[] = 'custom-background-white'; 336 347 337 348 return $classes; -
trunk/wp-content/themes/twentytwelve/style.css
r21279 r21325 452 452 } 453 453 @media screen and (min-width: 960px) { 454 body.custom-background #page { 454 body { 455 background-color: #e6e6e6; 456 } 457 body #page { 455 458 padding: 0 40px; 456 459 padding: 0 2.857142857rem; … … 462 465 -moz-box-shadow: 0 2px 6px rgba(100, 100, 100, 0.3); 463 466 box-shadow: 0 2px 6px rgba(100, 100, 100, 0.3); 467 } 468 body.custom-background-empty { 469 background-color: #fff; 470 } 471 body.custom-background-empty #page, 472 body.custom-background-white #page { 473 padding: 0; 474 margin-top: 0; 475 margin-bottom: 0; 476 box-shadow: none; 464 477 } 465 478 }
Note: See TracChangeset
for help on using the changeset viewer.