'bwt_box_background_color', 'default' => '#ffffff', 'label' => __('Background Color', 'bwt') ); $colors[] = array( 'slug'=>'bwt_box_text_color', 'default' => '#6c6c6c', 'label' => __('Text Color', 'bwt') ); $colors[] = array( 'slug'=>'bwt_box_second_text_color', 'default' => '#cecece', 'label' => __('Secondary Text Color', 'bwt') ); $colors[] = array( 'slug'=>'bwt_special_color', 'default' => '#cea525', 'label' => __('Special Color', 'bwt') ); foreach( $colors as $bwt_theme_options_colors ) { // SETTINGS $wp_customize->add_setting( 'bwt_theme_options_colors[' . $bwt_theme_options_colors['slug'] . ']', array( 'default' => $bwt_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, $bwt_theme_options_colors['slug'], array('label' => $bwt_theme_options_colors['label'], 'section' => 'colors', 'settings' =>'bwt_theme_options_colors[' . $bwt_theme_options_colors['slug'] . ']', ) ) ); } } add_action( 'customize_register', 'bwt_color_primary_register' ); /** * Add Custom CSS to Header */ function bwt_custom_css_styles() { global $bwt_theme_options_colors; $color_options = get_option( 'bwt_theme_options_colors', $bwt_theme_options_colors ); if( isset( $color_options[ 'bwt_box_background_color' ] ) ) { $bwt_box_background_color = $color_options['bwt_box_background_color']; } if( isset( $color_options[ 'bwt_box_text_color' ] ) ) { $bwt_box_text_color = $color_options['bwt_box_text_color']; } if( isset( $color_options[ 'bwt_box_second_text_color' ] ) ) { $bwt_box_second_text_color = $color_options['bwt_box_second_text_color']; } if( isset( $color_options[ 'bwt_special_color' ] ) ) { $bwt_special_color = $color_options['bwt_special_color']; } ?>