add_setting( 'header_bg_color', array( 'default' => '#d3670e', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'refresh', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'header_bg_color', array( 'label' => __( 'Header Background Color', 'broad' ), 'description' => __( 'Applied to the header.', 'broad' ), 'section' => 'colors', ) ) ); // Add custom navigation background color setting and control. $wp_customize->add_setting( 'nav_bg_color', array( 'default' => '#222222', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'refresh', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'nav_bg_color', array( 'label' => __( 'Navigation Background Color', 'broad' ), 'description' => __( 'Applied to the navigation.', 'broad' ), 'section' => 'colors', ) ) ); // Add custom navigation link color setting and control. $wp_customize->add_setting( 'nav_li_color', array( 'default' => '#d3670e', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'refresh', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'nav_li_color', array( 'label' => __( 'Navigation Link Color', 'broad' ), 'description' => __( 'Applied to the navigation link.', 'broad' ), 'section' => 'colors', ) ) ); // Add custom top menu color setting and control. $wp_customize->add_setting( 'top_menu_bg_color', array( 'default' => '#d3670e', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'refresh', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'top_menu_bg_color', array( 'label' => __( 'Top Menu Background Color', 'broad' ), 'description' => __( 'Applied to all top menu.', 'broad' ), 'section' => 'colors', ) ) ); // Add custom content background color setting and control. $wp_customize->add_setting( 'content_bgcolor', array( 'default' => '#e7e7e7', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'refresh', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'content_bgcolor', array( 'label' => __( 'Content Background Color', 'broad' ), 'description' => __( 'Applied to all content background color.', 'broad' ), 'section' => 'colors', ) ) ); // Add custom content color setting and control. $wp_customize->add_setting( 'content_color', array( 'default' => '#000000', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'refresh', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'content_color', array( 'label' => __( 'Content Color', 'broad' ), 'description' => __( 'Applied to all content color.', 'broad' ), 'section' => 'colors', ) ) ); // Add custom content mouseover background color setting and control. $wp_customize->add_setting( 'content_mouseover_bgcolor', array( 'default' => '#d3670e', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'refresh', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'content_mouseover_bgcolor', array( 'label' => __( 'Content Mouseover Background Color', 'broad' ), 'description' => __( 'Applied to all content mouseover background color.', 'broad' ), 'section' => 'colors', ) ) ); // Add custom content mouseover color setting and control. $wp_customize->add_setting( 'content_mouseover_color', array( 'default' => '#FFFFFF', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'refresh', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'content_mouseover_color', array( 'label' => __( 'Content Mouseover Color', 'broad' ), 'description' => __( 'Applied to all content mouseover.', 'broad' ), 'section' => 'colors', ) ) ); // Add custom footer background color setting and control. $wp_customize->add_setting( 'footer_bg_color', array( 'default' => '#d3670e', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'refresh', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'footer_bg_color', array( 'label' => __( 'Footer Background Color', 'broad' ), 'description' => __( 'Applied to the footer.', 'broad' ), 'section' => 'colors', ) ) ); // Add custom footer text color setting and control. $wp_customize->add_setting( 'footer_color', array( 'default' => '#ffffff', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'refresh', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'footer_color', array( 'label' => __( 'Footer Text Color', 'broad' ), 'description' => __( 'Applied to the footer.', 'broad' ), 'section' => 'colors', ) ) ); // Add custom footer link color setting and control. $wp_customize->add_setting( 'footer_link_color', array( 'default' => '#ffffff', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'refresh', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'footer_link_color', array( 'label' => __( 'Footer Link Color', 'broad' ), 'description' => __( 'Applied to the footer direct links.', 'broad' ), 'section' => 'colors', ) ) ); // Add custom link color setting and control. $wp_customize->add_setting( 'link_color', array( 'default' => '#d3670e', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'refresh', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'link_color', array( 'label' => __( 'Link Color', 'broad' ), 'description' => __( 'Applied to all direct link.', 'broad' ), 'section' => 'colors', ) ) ); // Add custom button background color setting and control. $wp_customize->add_setting( 'button_bg_color', array( 'default' => '#d3670e', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'refresh', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'button_bg_color', array( 'label' => __( 'Button Background Color', 'broad' ), 'description' => __( 'Applied to all button.', 'broad' ), 'section' => 'colors', ) ) ); } add_action( 'customize_register', 'broad_customize_register', 11 ); /** * Output the css. * * @since Broad 1.0 */ function broad_customize_css() { $footer_background_image = broad_get_option_data('footer_background_image'); if ($footer_background_image->option_activate == 1) { $footer_background_image = 'url("' . $footer_background_image->option_value . '") repeat scroll center top '; } else { $footer_background_image = ''; } ?> array( 'label' => __( 'Default', 'broad' ), 'colors' => array( '#f1f1f1', '#ffffff', '#ffffff', '#333333', '#333333', '#f7f7f7', ), ), 'dark' => array( 'label' => __( 'Dark', 'broad' ), 'colors' => array( '#111111', '#202020', '#202020', '#bebebe', '#bebebe', '#1b1b1b', ), ), 'yellow' => array( 'label' => __( 'Yellow', 'broad' ), 'colors' => array( '#f4ca16', '#ffdf00', '#ffffff', '#111111', '#111111', '#f1f1f1', ), ), 'pink' => array( 'label' => __( 'Pink', 'broad' ), 'colors' => array( '#ffe5d1', '#e53b51', '#ffffff', '#352712', '#ffffff', '#f1f1f1', ), ), 'purple' => array( 'label' => __( 'Purple', 'broad' ), 'colors' => array( '#674970', '#2e2256', '#ffffff', '#2e2256', '#ffffff', '#f1f1f1', ), ), 'blue' => array( 'label' => __( 'Blue', 'broad' ), 'colors' => array( '#e9f2f9', '#55c3dc', '#ffffff', '#22313f', '#ffffff', '#f1f1f1', ), ), ) ); } if ( ! function_exists( 'broad_get_color_scheme' ) ) : /** * Get the current Broad color scheme. * * @since Broad 1.0 * * @return array An associative array of either the current or default color scheme hex values. */ function broad_get_color_scheme() { $color_scheme_option = get_theme_mod( 'color_scheme', 'default' ); $color_schemes = broad_get_color_schemes(); if ( array_key_exists( $color_scheme_option, $color_schemes ) ) { return $color_schemes[ $color_scheme_option ]['colors']; } return $color_schemes['default']['colors']; } endif; // broad_get_color_scheme if ( ! function_exists( 'broad_get_color_scheme_choices' ) ) : /** * Returns an array of color scheme choices registered for Broad. * * @since Broad 1.0 * * @return array Array of color schemes. */ function broad_get_color_scheme_choices() { $color_schemes = broad_get_color_schemes(); $color_scheme_control_options = array(); foreach ( $color_schemes as $color_scheme => $value ) { $color_scheme_control_options[ $color_scheme ] = $value['label']; } return $color_scheme_control_options; } endif; // broad_get_color_scheme_choices if ( ! function_exists( 'broad_sanitize_color_scheme' ) ) : /** * Sanitization callback for color schemes. * * @since Broad 1.0 * * @param string $value Color scheme name value. * @return string Color scheme name. */ function broad_sanitize_color_scheme( $value ) { $color_schemes = broad_get_color_scheme_choices(); if ( ! array_key_exists( $value, $color_schemes ) ) { $value = 'default'; } return $value; } endif; // broad_sanitize_color_scheme