449 | | add_filter( 'body_class', 'twentyeleven_layout_classes' ); |
450 | | No newline at end of file |
| 450 | add_filter( 'body_class', 'twentyeleven_layout_classes' ); |
| 451 | |
| 452 | function twentyeleven_customize_register( $customize ) { |
| 453 | $defaults = twentyeleven_get_default_theme_options(); |
| 454 | |
| 455 | $customize->add_section( 'twentyeleven_colors', array( |
| 456 | 'title' => __( 'Colors', 'twentyeleven' ), |
| 457 | 'priority' => 33, |
| 458 | ) ); |
| 459 | |
| 460 | $customize->add_setting( 'twentyeleven_theme_options[color_scheme]', array( |
| 461 | 'type' => 'option', |
| 462 | 'default' => $defaults['color_scheme'], |
| 463 | 'sanitize_callback' => 'sanitize_key', |
| 464 | ) ); |
| 465 | |
| 466 | $customize->add_control( 'twentyeleven_theme_options[color_scheme]', array( |
| 467 | 'section' => 'twentyeleven_colors', |
| 468 | 'label' => __( 'Color Scheme', 'twentyeleven'), |
| 469 | 'type' => 'radio', |
| 470 | 'choices' => array( |
| 471 | 'light' => __('Light', 'twentyeleven'), |
| 472 | 'dark' => __('Dark', 'twentyeleven'), |
| 473 | ), |
| 474 | ) ); |
| 475 | |
| 476 | $customize->add_setting( 'twentyeleven_theme_options[link_color]', array( |
| 477 | 'type' => 'option', |
| 478 | 'default' => $defaults['link_color'], |
| 479 | 'sanitize_callback' => 'sanitize_hexcolor', |
| 480 | ) ); |
| 481 | |
| 482 | $customize->add_control( 'twentyeleven_theme_options[link_color]', array( |
| 483 | 'section' => 'twentyeleven_colors', |
| 484 | 'label' => __( 'Link Color', 'twentyeleven' ), |
| 485 | 'type' => 'color', |
| 486 | ) ); |
| 487 | |
| 488 | $customize->add_section( 'twentyeleven_layout', array( |
| 489 | 'title' => __( 'Default Layout', 'twentyeleven' ), |
| 490 | 'priority' => 35, |
| 491 | ) ); |
| 492 | |
| 493 | $customize->add_setting( 'twentyeleven_theme_options[theme_layout]', array( |
| 494 | 'type' => 'option', |
| 495 | 'default' => $defaults['theme_layout'], |
| 496 | 'sanitize_callback' => 'sanitize_key', |
| 497 | ) ); |
| 498 | |
| 499 | $customize->add_control( 'twentyeleven_theme_options[theme_layout]', array( |
| 500 | 'section' => 'twentyeleven_layout', |
| 501 | 'type' => 'radio', |
| 502 | 'choices' => array( |
| 503 | 'content-sidebar' => __('Content on left', 'twentyeleven'), |
| 504 | 'sidebar-content' => __('Content on right', 'twentyeleven'), |
| 505 | 'content' => __('One column, no sidebar', 'twentyeleven'), |
| 506 | ), |
| 507 | ) ); |
| 508 | } |
| 509 | add_action( 'customize_register', 'twentyeleven_customize_register' ); |