'bloggingwarrior_box_background_color', 'default' => '#ffffff', 'label' => __('Background Color', 'bloggingwarrior') ); $colors[] = array( 'slug'=>'bloggingwarrior_box_text_color', 'default' => '#6c6c6c', 'label' => __('Text Color', 'bloggingwarrior') ); $colors[] = array( 'slug'=>'bloggingwarrior_box_second_text_color', 'default' => '#cecece', 'label' => __('Secondary Text Color', 'bloggingwarrior') ); $colors[] = array( 'slug'=>'bloggingwarrior_special_color', 'default' => '#cea525', 'label' => __('Special Color', 'bloggingwarrior') ); foreach( $colors as $bloggingwarrior_theme_options_colors ) { // SETTINGS $wp_customize->add_setting( 'bloggingwarrior_theme_options_colors[' . $bloggingwarrior_theme_options_colors['slug'] . ']', array( 'default' => $bloggingwarrior_theme_options_colors['default'], 'type' => 'option', 'sanitize_callback' => 'sanitize_hex_color', 'capability' => 'edit_theme_options' ) ); // CONTROLS $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, $bloggingwarrior_theme_options_colors['slug'], array('label' => $bloggingwarrior_theme_options_colors['label'], 'section' => 'colors', 'settings' =>'bloggingwarrior_theme_options_colors[' . $bloggingwarrior_theme_options_colors['slug'] . ']', ) ) ); } } add_action( 'customize_register', 'bloggingwarrior_color_primary_register' ); /** * Add Custom CSS to Header */ function bloggingwarrior_custom_css_styles() { global $bloggingwarrior_theme_options_colors; $color_options = get_option( 'bloggingwarrior_theme_options_colors', $bloggingwarrior_theme_options_colors ); if( isset( $color_options[ 'bloggingwarrior_box_background_color' ] ) ) { $bloggingwarrior_box_background_color = $color_options['bloggingwarrior_box_background_color']; } if( isset( $color_options[ 'bloggingwarrior_box_text_color' ] ) ) { $bloggingwarrior_box_text_color = $color_options['bloggingwarrior_box_text_color']; } if( isset( $color_options[ 'bloggingwarrior_box_second_text_color' ] ) ) { $bloggingwarrior_box_second_text_color = $color_options['bloggingwarrior_box_second_text_color']; } if( isset( $color_options[ 'bloggingwarrior_special_color' ] ) ) { $bloggingwarrior_special_color = $color_options['bloggingwarrior_special_color']; } ?>