diff --git a/functions.php b/functions.php index 1a310bc..7805e31 100644 --- a/functions.php +++ b/functions.php @@ -97,6 +97,18 @@ function wp386_scripts() { } add_action( 'wp_enqueue_scripts', 'wp386_scripts' ); +/** + * Gets blog options. + */ +function wp386_blog_options() { + $options = get_option('wp386_options', array()); + $options = array_merge(array( + 'color_combination' => 'default' + ), $options); + + return $options; +} + /** * Custom template tags for this theme. */ @@ -112,6 +124,11 @@ require get_template_directory() . '/inc/extras.php'; */ require get_template_directory() . '/inc/customizer.php'; +/** + * Color theme support. + */ +require get_template_directory() . '/inc/theme-support.php'; + /** * Load Jetpack compatibility file. */ diff --git a/inc/customizer.php b/inc/customizer.php index 4dd1201..68df74c 100644 --- a/inc/customizer.php +++ b/inc/customizer.php @@ -13,7 +13,29 @@ function wp386_customize_register( $wp_customize ) { $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; - $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; + + $options = wp386_blog_options(); + + $wp_customize->add_setting( 'wp386_options[color_combination]', + array( + 'default' => $options['color_combination'], + 'type' => 'option', + 'capability' => 'edit_theme_options', + 'transport' => 'postMessage' + ) + ); + + $wp_customize->add_control( 'theme_color_combinations', array( + 'label' => __('Color Combinations', 'wp386'), + 'section' => 'colors', + 'settings' => 'wp386_options[color_combination]', + 'priority' => 10, + 'type' => 'radio', + 'choices' => array( + 'default' => 'Default Color Scheme', + 'blackonwhite' => 'Dark Text / Light Background' + ), + ) ); } add_action( 'customize_register', 'wp386_customize_register' ); diff --git a/inc/theme-support.php b/inc/theme-support.php new file mode 100644 index 0000000..67d4d7a --- /dev/null +++ b/inc/theme-support.php @@ -0,0 +1,14 @@ +