remove_section('colors'); // $wp_customize->remove_section('header_image'); $wp_customize->remove_section('background_image'); $wp_customize->remove_section('custom_css'); $wp_customize->add_section('company', array( 'title' => __('Company Info', 'aw-plus-awesome-blog'), 'priority' => 10 )); //color theme $wp_customize->add_section('color_theme', array( 'title' => __('Color of the Theme', 'aw-plus-awesome-blog'), 'priority' => 11 )); /* ========= Settings ===============*/ $wp_customize->add_setting('company_name', array( 'default' => 'Your Company', 'sanitize_callback' => 'znt_scape_html_tags', 'transport' => 'refresh' )); // color theme $wp_customize->add_setting('main_text_color', array( 'default' => '#444', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'refresh' )); $wp_customize->add_setting('background_color_theme', array( 'default' => '#fff', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'refresh' )); $wp_customize->add_setting('link_color_theme', array( 'default' => '#444', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'refresh' )); $wp_customize->add_setting('submenu_link_color_theme', array( 'default' => '#17a2b8', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'refresh' )); $wp_customize->add_setting('submenu_block_color_theme', array( 'default' => '#444', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'refresh' )); $wp_customize->add_setting('avatar_feacture_image', array( 'default' => get_template_directory_uri() . '/assets/img/avatar.jpg', 'sanitize_callback' => 'sanitize_file_name', 'transport' => 'refresh' )); /* ========= Controls ===============*/ $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'company_textbox', array( 'label' => __('Company Name', 'aw-plus-awesome-blog'), 'section' => 'company', 'settings' => 'company_name' ))); // color theme $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'main_text_color_control', array( 'label' => __('Text main color', 'aw-plus-awesome-blog'), 'section' => 'color_theme', 'settings' => 'main_text_color' ))); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'background_theme_color_control', array( 'label' => __('Background color', 'aw-plus-awesome-blog'), 'section' => 'color_theme', 'settings' => 'background_color_theme' ))); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'link_theme_color_control', array( 'label' => __('Links color', 'aw-plus-awesome-blog'), 'section' => 'color_theme', 'settings' => 'link_color_theme' ))); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'submenu_link_theme_color_control', array( 'label' => __('Links submenu color', 'aw-plus-awesome-blog'), 'section' => 'color_theme', 'settings' => 'submenu_link_color_theme' ))); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'submenu_block_theme_color_control', array( 'label' => __('Submenu block color', 'aw-plus-awesome-blog'), 'section' => 'color_theme', 'settings' => 'submenu_block_color_theme' ))); $wp_customize->add_control(new WP_Customize_Cropped_Image_Control($wp_customize, 'avatar_image_control', array( 'label' => __('Featured Avatar image', 'aw-plus-awesome-blog'), 'section' => 'company', 'settings' => 'avatar_feacture_image', 'mime_type' => 'image', 'width' => 170, 'height' => 170 ))); /* ================================ sanitaze function ===================================*/ function znt_scape_html_tags($value) { return strip_tags($value); } }