'blogwarrior_box_background_color', 'default' => '#ffffff', 'label' => __('Background Color', 'blogwarrior') ); $colors[] = array( 'slug'=>'blogwarrior_box_text_color', 'default' => '#6c6c6c', 'label' => __('Text Color', 'blogwarrior') ); $colors[] = array( 'slug'=>'blogwarrior_box_second_text_color', 'default' => '#cecece', 'label' => __('Secondary Text Color', 'blogwarrior') ); $colors[] = array( 'slug'=>'blogwarrior_special_color', 'default' => '#cea525', 'label' => __('Special Color', 'blogwarrior') ); foreach( $colors as $blogwarrior_theme_options_colors ) { // SETTINGS $wp_customize->add_setting( 'blogwarrior_theme_options_colors[' . $blogwarrior_theme_options_colors['slug'] . ']', array( 'default' => $blogwarrior_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, $blogwarrior_theme_options_colors['slug'], array('label' => $blogwarrior_theme_options_colors['label'], 'section' => 'colors', 'settings' =>'blogwarrior_theme_options_colors[' . $blogwarrior_theme_options_colors['slug'] . ']', ) ) ); } } add_action( 'customize_register', 'blogwarrior_color_primary_register' ); /** * Add Custom CSS to Header */ function blogwarrior_custom_css_styles() { global $blogwarrior_theme_options_colors; $color_options = get_option( 'blogwarrior_theme_options_colors', $blogwarrior_theme_options_colors ); if( isset( $color_options[ 'blogwarrior_box_background_color' ] ) ) { $blogwarrior_box_background_color = $color_options['blogwarrior_box_background_color']; } if( isset( $color_options[ 'blogwarrior_box_text_color' ] ) ) { $blogwarrior_box_text_color = $color_options['blogwarrior_box_text_color']; } if( isset( $color_options[ 'blogwarrior_box_second_text_color' ] ) ) { $blogwarrior_box_second_text_color = $color_options['blogwarrior_box_second_text_color']; } if( isset( $color_options[ 'blogwarrior_special_color' ] ) ) { $blogwarrior_special_color = $color_options['blogwarrior_special_color']; } ?>