add_setting( 'blackcolors_barra_color', array( 'default' => '#2c3e50', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'blackcolors_barra_color', array( 'label' => __('Fixed Bar Background Color', 'blackcolors'), 'section' => 'colors', 'settings' => 'blackcolors_barra_color', ) ) ); /* Text color /*--------------------------------------*/ $wp_customize->add_setting( 'blackcolors_texto_color', array( 'default' => '#ffffff', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'blackcolors_texto_color', array( 'label' => __('Text Color', 'blackcolors'), 'section' => 'colors', 'settings' => 'blackcolors_texto_color', ) ) ); /* Links color /*--------------------------------------*/ $wp_customize->add_setting( 'blackcolors_links_color', array( 'default' => '#e67e22', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'blackcolors_links_color', array( 'label' => __('Links Color', 'blackcolors'), 'section' => 'colors', 'settings' => 'blackcolors_links_color', ) ) ); /* Links color when hover /*--------------------------------------*/ $wp_customize->add_setting( 'blackcolors_links_hover', array( 'default' => '#f1c40f', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'blackcolors_links_hover', array( 'label' => __('Links color when mouse is hover', 'blackcolors'), 'section' => 'colors', 'settings' => 'blackcolors_links_hover', ) ) ); /* Social Links Color /*--------------------------------------*/ $wp_customize->add_setting( 'blackcolors_social_links', array( 'default' => '#f1c40f', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'blackcolors_social_links', array( 'label' => __('Color for the social icons', 'blackcolors'), 'section' => 'colors', 'settings' => 'blackcolors_social_links', ) ) ); /* Galleries background color /*--------------------------------------*/ $wp_customize->add_setting( 'blackcolors_galeria_color', array( 'default' => '#34495e', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'blackcolors_galeria_color', array( 'label' => __('Gallery Background Color', 'blackcolors'), 'section' => 'colors', 'settings' => 'blackcolors_galeria_color', ) ) ); /* Add Section for blackcolors Boxes /*--------------------------------------*/ $wp_customize->add_section( 'blackcolors_boxes', array( 'title' => __( 'Blackcolors Boxes', 'blackcolors' ), 'description' => __( 'Change the url, text and icons of every color box.
For the icons, just go to Fontawesome Icons, select and copy in the respective textbox the name of the icons. For instance, to add the facebook icon, copy "fa-facebook"','blackcolors'), 'priority' => 35, ) ); /* Text and URL for Box 1 /*-------------------------*/ for($i = 1; $i <= 5; $i++){ $wp_customize->add_setting( 'blackcolors_box1_text', array( 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'blackcolors_box1_text', array( 'settings' => 'blackcolors_box1_text', 'label' => __( 'Text on Box 1: ', 'blackcolors' ), 'section' => 'blackcolors_boxes', 'type' => 'text', 'priority' => 1, ) ) ); $wp_customize->add_setting( 'blackcolors_box1_url', array( 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_url', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'blackcolors_box1_url', array( 'settings' => 'blackcolors_box1_url', 'label' => __( 'URL on Box 1: ', 'blackcolors' ), 'section' => 'blackcolors_boxes', 'type' => 'text', 'priority' => 2, ) ) ); $wp_customize->add_setting( 'blackcolors_box1_icon', array( 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_attr', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'blackcolors_box1_icon', array( 'settings' => 'blackcolors_box1_icon', 'label' => __( 'Icon on Box 1: ', 'blackcolors' ), 'section' => 'blackcolors_boxes', 'type' => 'text', 'priority' => 3, ) ) ); } /* Text and URL for Box 2 /*-------------------------*/ $wp_customize->add_setting( 'blackcolors_box2_text', array( 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'blackcolors_box2_text', array( 'settings' => 'blackcolors_box2_text', 'label' => __( 'Text on Box 2: ', 'blackcolors' ), 'section' => 'blackcolors_boxes', 'type' => 'text', 'priority' => 4, ) ) ); $wp_customize->add_setting( 'blackcolors_box2_url', array( 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_url', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'blackcolors_box2_url', array( 'settings' => 'blackcolors_box2_url', 'label' => __( 'URL on Box 2: ', 'blackcolors' ), 'section' => 'blackcolors_boxes', 'type' => 'text', 'priority' => 5, ) ) ); $wp_customize->add_setting( 'blackcolors_box2_icon', array( 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_attr', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'blackcolors_box2_icon', array( 'settings' => 'blackcolors_box2_icon', 'label' => __( 'Icon on Box 2: ', 'blackcolors' ), 'section' => 'blackcolors_boxes', 'type' => 'text', 'priority' => 6, ) ) ); /* Text and URL for Box 3 /*-------------------------*/ $wp_customize->add_setting( 'blackcolors_box3_text', array( 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'blackcolors_box3_text', array( 'settings' => 'blackcolors_box3_text', 'label' => __( 'Text on Box 3: ', 'blackcolors' ), 'section' => 'blackcolors_boxes', 'priority' => 7, 'type' => 'text', ) ) ); $wp_customize->add_setting( 'blackcolors_box3_url', array( 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_url', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'blackcolors_box3_url', array( 'settings' => 'blackcolors_box3_url', 'label' => __( 'URL on Box 3: ', 'blackcolors' ), 'section' => 'blackcolors_boxes', 'type' => 'text', 'priority' => 8, ) ) ); $wp_customize->add_setting( 'blackcolors_box3_icon', array( 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_attr', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'blackcolors_box3_icon', array( 'settings' => 'blackcolors_box3_icon', 'label' => __( 'Icon on Box 3: ', 'blackcolors' ), 'section' => 'blackcolors_boxes', 'type' => 'text', 'priority' => 9, ) ) ); /* Text and URL for Box 4 /*-------------------------*/ $wp_customize->add_setting( 'blackcolors_box4_text', array( 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'blackcolors_box4_text', array( 'settings' => 'blackcolors_box4_text', 'label' => __( 'Text on Box 4: ', 'blackcolors' ), 'section' => 'blackcolors_boxes', 'priority' => 10, 'type' => 'text', ) ) ); $wp_customize->add_setting( 'blackcolors_box4_url', array( 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_url', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'blackcolors_box4_url', array( 'settings' => 'blackcolors_box4_url', 'label' => __( 'URL on Box 4: ', 'blackcolors' ), 'section' => 'blackcolors_boxes', 'type' => 'text', 'priority' => 11, ) ) ); $wp_customize->add_setting( 'blackcolors_box4_icon', array( 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_attr', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'blackcolors_box4_icon', array( 'settings' => 'blackcolors_box4_icon', 'label' => __( 'Icon on Box 4: ', 'blackcolors' ), 'section' => 'blackcolors_boxes', 'type' => 'text', 'priority' => 12, ) ) ); /* Text and URL for Box 5 /*-------------------------*/ $wp_customize->add_setting( 'blackcolors_box5_text', array( 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'blackcolors_box5_text', array( 'settings' => 'blackcolors_box5_text', 'label' => __( 'Text on Box 5: ', 'blackcolors' ), 'section' => 'blackcolors_boxes', 'priority' => 13, 'type' => 'text', ) ) ); $wp_customize->add_setting( 'blackcolors_box5_url', array( 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_url', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'blackcolors_box5_url', array( 'settings' => 'blackcolors_box5_url', 'label' => __( 'URL on Box 5: ', 'blackcolors' ), 'section' => 'blackcolors_boxes', 'type' => 'text', 'priority' => 14, ) ) ); $wp_customize->add_setting( 'blackcolors_box5_icon', array( 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_attr', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'blackcolors_box5_icon', array( 'settings' => 'blackcolors_box5_icon', 'label' => __( 'Icon on Box 5: ', 'blackcolors' ), 'section' => 'blackcolors_boxes', 'type' => 'text', 'priority' => 15, ) ) ); /* Add Section for Social Icons /*--------------------------------------*/ $wp_customize->add_section( 'blackcolors_social_icons', array( 'title' => __( 'Blackcolors Social Icons', 'blackcolors' ), 'priority' => 35, ) ); /* Add setting und control for every social icon /*--------------------------------------*/ $blackcolors_social_services = array('fa-twitter' => 'Twitter', 'fa-facebook' => 'Facebook', 'fa-google-plus' => 'Google+', 'fa-behance' => 'Behance', 'fa-codepen' => 'Codepen', 'fa-github' => 'GitHub', 'fa-linkedin' => 'LinkeIn', 'fa-skype' => 'Skype', 'fa-youtube' => 'YouTube', 'fa-slack' => 'Slack', 'fa-tumblr' => 'Tumblr', 'fa-yelp' => 'Yelp', 'fa-instagram' => 'Instagram', 'fa-pinterest' => 'Pinterest', 'fa-flickr' => 'Flickr', 'fa-stack-exchange' => 'Stack Exchange'); $a = 1; foreach($blackcolors_social_services as $id => $valor){ $wp_customize->add_setting( "blackcolors_$id", array( 'default' => $id, 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_url', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, "blackcolors_$id", array( 'settings' => "blackcolors_$id", 'label' => $valor, // <- Translation function calls must NOT contain PHP variables. Var contains just non-translatable International Brands 'section' => 'blackcolors_social_icons', 'type' => 'text', 'priority' => $a, ) ) ); $a++; } } ?>