add_setting( 'cgs_fashion_trend_link_color', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_hex_color' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize,'cgs_fashion_trend_link_color',array( 'label' => __('Link color', 'cgs-fashion-trend'), 'section' => 'colors', 'settings' => 'cgs_fashion_trend_link_color', 'priority' => 1, ) ) ); /* Button Color */ $wp_customize->add_setting( 'cgs_fashion_trend_button_color', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_hex_color' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize,'cgs_fashion_trend_button_color',array( 'label' => __('Button color', 'cgs-fashion-trend'), 'section' => 'colors', 'settings' => 'cgs_fashion_trend_button_color', 'priority' => 1, ) ) ); /* H1 Color */ $wp_customize->add_setting( 'cgs_fashion_trend_h1_color', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_hex_color' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize,'cgs_fashion_trend_h1_color',array( 'label' => __('H1 Tag Color', 'cgs-fashion-trend'), 'section' => 'colors', 'settings' => 'cgs_fashion_trend_h1_color', 'priority' => 1, ) ) ); /* H2 Color */ $wp_customize->add_setting( 'cgs_fashion_trend_h2_color', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_hex_color' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize,'cgs_fashion_trend_h2_color',array( 'label' => __('H2 Tag Color', 'cgs-fashion-trend'), 'section' => 'colors', 'settings' => 'cgs_fashion_trend_h2_color', 'priority' => 1, ) ) ); /* H3 Color */ $wp_customize->add_setting( 'cgs_fashion_trend_h3_color', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_hex_color' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize,'cgs_fashion_trend_h3_color',array( 'label' => __('H3 Tag Color', 'cgs-fashion-trend'), 'section' => 'colors', 'settings' => 'cgs_fashion_trend_h3_color', 'priority' => 1, ) ) ); /* H4 Color */ $wp_customize->add_setting( 'cgs_fashion_trend_h4_color', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_hex_color' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize,'cgs_fashion_trend_h4_color',array( 'label' => __('H4 Tag Color', 'cgs-fashion-trend'), 'section' => 'colors', 'settings' => 'cgs_fashion_trend_h4_color', 'priority' => 1, ) ) ); /* p tag Color */ $wp_customize->add_setting( 'cgs_fashion_trend_p_color', array( 'default' => '', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_hex_color' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize,'cgs_fashion_trend_p_color',array( 'label' => __('P Tag Color', 'cgs-fashion-trend'), 'section' => 'colors', 'settings' => 'cgs_fashion_trend_p_color', 'priority' => 1, ) ) ); /* Banner Section */ $wp_customize->add_setting( 'cgs_fashion_trend_setting_small_img', array( 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize,'cgs_fashion_trend_setting_small_img',array( 'label' => __('Upload image on header banner', 'cgs-fashion-trend'), 'description' => __('Image Size should be 490px X 690px', 'cgs-fashion-trend'), 'section' => 'header_image', 'settings' => 'cgs_fashion_trend_setting_small_img', 'priority' => 1, ) ) ); $wp_customize->add_setting( 'cgs_fashion_trend_setting_h1_text', array( 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize,'cgs_fashion_trend_setting_h1_text',array( 'label' => __('Header text on banner', 'cgs-fashion-trend'), 'section' => 'header_image', 'settings' => 'cgs_fashion_trend_setting_h1_text', 'type' => 'text', 'priority' => 1 ) ) ); $wp_customize->add_setting( 'cgs_fashion_trend_setting_p_text', array( 'sanitize_callback' => 'sanitize_textarea_field' ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize,'cgs_fashion_trend_setting_p_text',array( 'label' => __('Header text on banner', 'cgs-fashion-trend'), 'section' => 'header_image', 'settings' => 'cgs_fashion_trend_setting_p_text', 'type' => 'textarea', 'priority' => 1, ) ) ); $wp_customize->add_setting( 'cgs_fashion_trend_customizer_select', array( 'sanitize_callback' => 'cgs_fashion_trend_select_sanitize' ) ); $wp_customize->add_control( 'cgs_fashion_trend_customizer_select', array( 'label' => esc_html__( 'Display banner in inner-pages', 'cgs-fashion-trend' ), 'section' => 'header_image', 'type' => 'select', 'choices' => array( '' => esc_html__('Please select','cgs-fashion-trend'), 'yes' => esc_html__('Yes','cgs-fashion-trend'), 'no' => esc_html__('No','cgs-fashion-trend') ) ) ); /* */ $wp_customize->add_panel( 'cgs_fashion_trend_design_options', array( 'capabitity' => 'edit_theme_options', 'priority' => 505, 'title' => esc_html__( 'Design', 'cgs-fashion-trend' ), ) ); $wp_customize->add_section( 'cgs_fashion_trend_page_layout_setting', array( 'priority' => 1, 'title' => esc_html__( 'Default layout for pages only', 'cgs-fashion-trend' ), 'panel' => 'cgs_fashion_trend_design_options', ) ); $wp_customize->add_setting( 'cgs_fashion_trend_pages_default_layout', array( 'default' => 'left_sidebar', 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'cgs_fashion_trend_select_sanitize', ) ); $wp_customize->add_control( new Cgs_Fashion_Trend_Image_Radio_Control( $wp_customize,'cgs_fashion_trend_pages_default_layout', array( 'type' => 'radio', 'label' => esc_html__( 'Select default layout for pages. This layout will be reflected in all pages unless unique layout is set for specific page.', 'cgs-fashion-trend' ), 'section' => 'cgs_fashion_trend_page_layout_setting', 'settings' => 'cgs_fashion_trend_pages_default_layout', 'choices' => array( 'right_sidebar' => get_template_directory_uri(). '/images/right-sidebar.png', 'left_sidebar' => get_template_directory_uri(). '/images/left-sidebar.png', ), ) ) ); function cgs_fashion_trend_select_sanitize( $input, $setting ){ $input = sanitize_key($input); $choices = $setting->manager->get_control( $setting->id )->choices; return ( array_key_exists( $input, $choices ) ? $input : $setting->default ); } } add_action( 'customize_register', 'cgs_fashion_trend_customize_register' );