Ticket #21226: 21226.2.diff
File 21226.2.diff, 2.3 KB (added by , 13 years ago) |
---|
-
wp-content/themes/twentytwelve/functions.php
71 71 register_nav_menu( 'primary', __( 'Primary Menu', 'twentytwelve' ) ); 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. 77 79 add_theme_support( 'post-thumbnails' ); … … 302 304 /** 303 305 * Extends the default WordPress body class to denote a full-width layout. 304 306 * 305 * Used in two cases: no active widgets in sidebar, and full-width page template. 307 * 'full-width' used for no active widgets in sidebar, and full-width page template. 308 * 'white-background' used for white custom background color. 306 309 * 307 310 * @since Twenty Twelve 1.0 308 311 */ 309 312 function twentytwelve_body_class( $classes ) { 313 $background_color = get_background_color(); 314 310 315 if ( ! is_active_sidebar( 'sidebar-1' ) || is_page_template( 'full-width' ) ) 311 316 $classes[] = 'full-width'; 312 317 318 if ( empty( $background_color ) ) 319 $classes[] = 'custom-background-empty'; 320 elseif ( in_array( $background_color, array( 'fff', 'ffffff' ) ) ) 321 $classes[] = 'custom-background-white'; 322 313 323 return $classes; 314 324 } 315 325 add_filter( 'body_class', 'twentytwelve_body_class' ); -
wp-content/themes/twentytwelve/style.css
435 435 } 436 436 } 437 437 @media screen and (min-width: 960px) { 438 body.custom-background #page { 438 body { 439 background-color: #e6e6e6; 440 } 441 body #page { 439 442 padding: 0 40px; 440 443 padding: 0 2.857142857rem; 441 444 margin-top: 48px; … … 446 449 -moz-box-shadow: 0 2px 6px rgba(100, 100, 100, 0.3); 447 450 box-shadow: 0 2px 6px rgba(100, 100, 100, 0.3); 448 451 } 452 body.custom-background-empty { 453 background-color: #fff; 454 } 455 body.custom-background-empty #page, 456 body.custom-background-white #page { 457 padding: 0; 458 margin-top: 0; 459 margin-bottom: 0; 460 box-shadow: none; 461 } 449 462 } 450 463 #main { 451 464 zoom: 1;