<?php    
/**
 *kidsi-pro Theme Customizer
 *
 * @package Kidsi Pro
 */

/**
 * Add postMessage support for site title and description for the Theme Customizer.
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
function kidsi_pro_customize_register( $wp_customize ) {	
	
	function kidsi_pro_sanitize_dropdown_pages( $page_id, $setting ) {
	  // Ensure $input is an absolute integer.
	  $page_id = absint( $page_id );	
	  // If $page_id is an ID of a published page, return it; otherwise, return the default.
	  return ( 'publish' == get_post_status( $page_id ) ? $page_id : $setting->default );
	}

	function kidsi_pro_sanitize_checkbox( $checked ) {
		// Boolean check.
		return ( ( isset( $checked ) && true == $checked ) ? true : false );
	} 
	
	function kidsi_pro_sanitize_phone_number( $phone ) {
		// sanitize phone
		return preg_replace( '/[^\d+]/', '', $phone );
	} 
	
	
	function kidsi_pro_sanitize_excerptrange( $number, $setting ) {	
		// Ensure input is an absolute integer.
		$number = absint( $number );	
		// Get the input attributes associated with the setting.
		$atts = $setting->manager->get_control( $setting->id )->input_attrs;	
		// Get minimum number in the range.
		$min = ( isset( $atts['min'] ) ? $atts['min'] : $number );	
		// Get maximum number in the range.
		$max = ( isset( $atts['max'] ) ? $atts['max'] : $number );	
		// Get step.
		$step = ( isset( $atts['step'] ) ? $atts['step'] : 1 );	
		// If the number is within the valid range, return it; otherwise, return the default
		return ( $min <= $number && $number <= $max && is_int( $number / $step ) ? $number : $setting->default );
	}

	function kidsi_pro_sanitize_number_absint( $number, $setting ) {
		// Ensure $number is an absolute integer (whole number, zero or greater).
		$number = absint( $number );		
		// If the input is an absolute integer, return it; otherwise, return the default
		return ( $number ? $number : $setting->default );
	}
	
	// Ensure is an absolute integer
	function kidsi_pro_sanitize_choices( $input, $setting ) {
		global $wp_customize; 
		$control = $wp_customize->get_control( $setting->id ); 
		if ( array_key_exists( $input, $control->choices ) ) {
			return $input;
		} else {
			return $setting->default;
		}
	}
	
		
	$wp_customize->get_setting( 'blogname' )->transport         = 'postMessage';
	$wp_customize->get_setting( 'blogdescription' )->transport  = 'postMessage';
	
	$wp_customize->selective_refresh->add_partial( 'blogname', array(
		'selector' => '.logo h1 a',
		'render_callback' => 'kidsi_pro_customize_partial_blogname',
	) );
	$wp_customize->selective_refresh->add_partial( 'blogdescription', array(
		'selector' => '.logo p',
		'render_callback' => 'kidsi_pro_customize_partial_blogdescription',
	) );
		
	 	
	 //Panel for section & control
	$wp_customize->add_panel( 'kidsi_pro_themeoptions_panel', array(
		'priority' => 4,
		'capability' => 'edit_theme_options',
		'theme_supports' => '',
		'title' => __( 'Kidsi Pro Settings', 'kidsi-pro' ),		
	) );

	$wp_customize->add_section('kidsi_pro_siteboxlayout_settings',array(
		'title' => __('Site Layout Options','kidsi-pro'),			
		'priority' => 1,
		'panel' => 	'kidsi_pro_themeoptions_panel',          
	));		
	
	$wp_customize->add_setting('kidsi_pro_layouttype',array(
		'sanitize_callback' => 'kidsi_pro_sanitize_checkbox',
	));	 

	$wp_customize->add_control( 'kidsi_pro_layouttype', array(
    	'section'   => 'kidsi_pro_siteboxlayout_settings',    	 
		'label' => __('Check to Show Box Layout','kidsi-pro'),
		'description' => __('check for box layout','kidsi-pro'),
    	'type'      => 'checkbox'
     )); //Box Layout Options 
	
	$wp_customize->add_setting('kidsi_pro_oneclick_colorcode',array(
		'default' => '#812570',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	
	$wp_customize->add_control(
		new WP_Customize_Color_Control($wp_customize,'kidsi_pro_oneclick_colorcode',array(
			'label' => __('OneClick Color Settings','kidsi-pro'),			
			'section' => 'colors',
			'settings' => 'kidsi_pro_oneclick_colorcode'
		))
	);
	
	$wp_customize->add_setting('kidsi_pro_menucolor',array(
		'default' => '#ffffff',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	
	$wp_customize->add_control(
		new WP_Customize_Color_Control($wp_customize,'kidsi_pro_menucolor',array(
			'label' => __('Navigation font Color','kidsi-pro'),			
			'section' => 'colors',
			'settings' => 'kidsi_pro_menucolor'
		))
	);
	
	
	$wp_customize->add_setting('kidsi_pro_menuactive',array(
		'default' => '#000000',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	
	$wp_customize->add_control(
		new WP_Customize_Color_Control($wp_customize,'kidsi_pro_menuactive',array(
			'label' => __('Navigation Hover/Active Color','kidsi-pro'),			
			'section' => 'colors',
			'settings' => 'kidsi_pro_menuactive'
		))
	);
	
	 //Header info Bar
	$wp_customize->add_section('kidsi_pro_contactdetails_settings',array(
		'title' => __('Header Contact Details','kidsi-pro'),				
		'priority' => null,
		'panel' => 	'kidsi_pro_themeoptions_panel',
	));		
	
	$wp_customize->add_setting('kidsi_pro_emailtext',array(
		'default' => null,
		'sanitize_callback' => 'sanitize_text_field'	
	));
	
	$wp_customize->add_control('kidsi_pro_emailtext',array(	
		'type' => 'text',
		'label' => __('write email text here','kidsi-pro'),
		'section' => 'kidsi_pro_contactdetails_settings',
		'setting' => 'kidsi_pro_emailtext'
	)); //write email text here		
	
	
	$wp_customize->add_setting('kidsi_pro_emailid',array(
		'sanitize_callback' => 'sanitize_email'
	));
	
	$wp_customize->add_control('kidsi_pro_emailid',array(
		'type' => 'email',
		'label' => __('enter email id here.','kidsi-pro'),
		'section' => 'kidsi_pro_contactdetails_settings'
	));	
	
	$wp_customize->add_setting('kidsi_pro_callustext',array(
		'default' => null,
		'sanitize_callback' => 'sanitize_text_field'	
	));
	
	$wp_customize->add_control('kidsi_pro_callustext',array(	
		'type' => 'text',
		'label' => __('write call us text here','kidsi-pro'),
		'section' => 'kidsi_pro_contactdetails_settings',
		'setting' => 'kidsi_pro_callustext'
	)); //write email text here		
	
	
	$wp_customize->add_setting('kidsi_pro_phonenumber',array(
		'default' => null,
		'sanitize_callback' => 'kidsi_pro_sanitize_phone_number'	
	));
	
	$wp_customize->add_control('kidsi_pro_phonenumber',array(	
		'type' => 'text',
		'label' => __('Enter phone number here','kidsi-pro'),
		'section' => 'kidsi_pro_contactdetails_settings',
		'setting' => 'kidsi_pro_phonenumber'
	));	
		
	
	$wp_customize->add_setting('kidsi_pro_show_contactdetails_settings',array(
		'default' => false,
		'sanitize_callback' => 'kidsi_pro_sanitize_checkbox',
		'capability' => 'edit_theme_options',
	));	 
	
	$wp_customize->add_control( 'kidsi_pro_show_contactdetails_settings', array(
	   'settings' => 'kidsi_pro_show_contactdetails_settings',
	   'section'   => 'kidsi_pro_contactdetails_settings',
	   'label'     => __('Check To show This Section','kidsi-pro'),
	   'type'      => 'checkbox'
	 ));//Show Contact Details
	
	 	
	//Slider Section		
	$wp_customize->add_section( 'kidsi_pro_slider_settings', array(
		'title' => __('Slider Settings', 'kidsi-pro'),
		'priority' => null,
		'description' => __('Default image size for slider is 1400 x 800 pixel.','kidsi-pro'), 
		'panel' => 	'kidsi_pro_themeoptions_panel',           			
    ));
	
	$wp_customize->add_setting('kidsi_pro_headerslide1',array(
		'default' => '0',			
		'capability' => 'edit_theme_options',
		'sanitize_callback' => 'kidsi_pro_sanitize_dropdown_pages'
	));
	
	$wp_customize->add_control('kidsi_pro_headerslide1',array(
		'type' => 'dropdown-pages',
		'label' => __('Select page for slide 1:','kidsi-pro'),
		'section' => 'kidsi_pro_slider_settings'
	));	
	
	$wp_customize->add_setting('kidsi_pro_headerslide2',array(
		'default' => '0',			
		'capability' => 'edit_theme_options',
		'sanitize_callback' => 'kidsi_pro_sanitize_dropdown_pages'
	));
	
	$wp_customize->add_control('kidsi_pro_headerslide2',array(
		'type' => 'dropdown-pages',
		'label' => __('Select page for slide 2:','kidsi-pro'),
		'section' => 'kidsi_pro_slider_settings'
	));	
	
	$wp_customize->add_setting('kidsi_pro_headerslide3',array(
		'default' => '0',			
		'capability' => 'edit_theme_options',
		'sanitize_callback' => 'kidsi_pro_sanitize_dropdown_pages'
	));
	
	$wp_customize->add_control('kidsi_pro_headerslide3',array(
		'type' => 'dropdown-pages',
		'label' => __('Select page for slide 3:','kidsi-pro'),
		'section' => 'kidsi_pro_slider_settings'
	));	// Homepage Slider Section	
	
	//Slider Excerpt Length
	$wp_customize->add_setting( 'kidsi_pro_excerpt_length_forslides', array(
		'default'              => 15,
		'type'                 => 'theme_mod',		
		'sanitize_callback'    => 'kidsi_pro_sanitize_excerptrange',		
	) );
	$wp_customize->add_control( 'kidsi_pro_excerpt_length_forslides', array(
		'label'       => __( 'Slider Description length','kidsi-pro' ),
		'section'     => 'kidsi_pro_slider_settings',
		'type'        => 'range',
		'settings'    => 'kidsi_pro_excerpt_length_forslides','input_attrs' => array(
			'step'             => 1,
			'min'              => 0,
			'max'              => 50,
		),
	) );	
	
	$wp_customize->add_setting('kidsi_pro_headerslide_btntext',array(
		'default' => null,
		'sanitize_callback' => 'sanitize_text_field'	
	));
	
	$wp_customize->add_control('kidsi_pro_headerslide_btntext',array(	
		'type' => 'text',
		'label' => __('enter button name here','kidsi-pro'),
		'section' => 'kidsi_pro_slider_settings',
		'setting' => 'kidsi_pro_headerslide_btntext'
	)); // slider read more button text
	
	$wp_customize->add_setting('kidsi_pro_show_slider_settings',array(
		'default' => false,
		'sanitize_callback' => 'kidsi_pro_sanitize_checkbox',
		'capability' => 'edit_theme_options',
	));	 
	
	$wp_customize->add_control( 'kidsi_pro_show_slider_settings', array(
	    'settings' => 'kidsi_pro_show_slider_settings',
	    'section'   => 'kidsi_pro_slider_settings',
	    'label'     => __('Check To Show This Section','kidsi-pro'),
	   'type'      => 'checkbox'
	 ));//Show Slider Settings	
	 
	 
	//Abous US section
	$wp_customize->add_section('kidsi_pro_aboutsection_settings', array(
		'title' => __('About Us Section','kidsi-pro'),
		'description' => __('Select Pages from the dropdown for about us section','kidsi-pro'),
		'priority' => null,
		'panel' => 	'kidsi_pro_themeoptions_panel',          
	));	
	
	$wp_customize->add_setting('kidsi_pro_aboutsubtitle',array(
		'default' => null,
		'sanitize_callback' => 'sanitize_text_field'	
	));
	
	$wp_customize->add_control('kidsi_pro_aboutsubtitle',array(	
		'type' => 'text',
		'label' => __('write about us sub title here','kidsi-pro'),
		'section' => 'kidsi_pro_aboutsection_settings',
		'setting' => 'kidsi_pro_aboutsubtitle'
	)); //write about sub title here	
	
	$wp_customize->add_setting('kidsi_pro_aboutpage',array(
		'default' => '0',			
		'capability' => 'edit_theme_options',
		'sanitize_callback' => 'kidsi_pro_sanitize_dropdown_pages'
	));
 
	$wp_customize->add_control(	'kidsi_pro_aboutpage',array(
		'type' => 'dropdown-pages',			
		'section' => 'kidsi_pro_aboutsection_settings',
	));	
	
	
	$wp_customize->add_setting('kidsi_pro_aboutquote',array(
		'default' => null,
		'sanitize_callback' => 'sanitize_text_field'	
	));
	
	$wp_customize->add_control('kidsi_pro_aboutquote',array(	
		'type' => 'text',
		'label' => __('write about quote text here','kidsi-pro'),
		'section' => 'kidsi_pro_aboutsection_settings',
		'setting' => 'kidsi_pro_aboutquote'
	)); //write about quote here	
	
	
	//About us Excerpt Length
	$wp_customize->add_setting( 'kidsi_pro_aboutus_excerptlength', array(
		'default'              => 40,
		'type'                 => 'theme_mod',		
		'sanitize_callback'    => 'kidsi_pro_sanitize_excerptrange',		
	) );
	$wp_customize->add_control( 'kidsi_pro_aboutus_excerptlength', array(
		'label'       => __( 'About us excerpt length','kidsi-pro' ),
		'section'     => 'kidsi_pro_aboutsection_settings',
		'type'        => 'range',
		'settings'    => 'kidsi_pro_aboutus_excerptlength','input_attrs' => array(
			'step'             => 1,
			'min'              => 0,
			'max'              => 50,
		),
	) );	
	
	
	$wp_customize->add_setting('kidsi_pro_show_aboutus_section',array(
		'default' => false,
		'sanitize_callback' => 'kidsi_pro_sanitize_checkbox',
		'capability' => 'edit_theme_options',
	));	 
	
	$wp_customize->add_control( 'kidsi_pro_show_aboutus_section', array(
	    'settings' => 'kidsi_pro_show_aboutus_section',
	    'section'   => 'kidsi_pro_aboutsection_settings',
	    'label'     => __('Check To Show This Section','kidsi-pro'),
	    'type'      => 'checkbox'
	));//Show About Us sections
	
	
	//Video section
	$wp_customize->add_section('kidsi_pro_video_section', array(
		'title' => __('Video Section','kidsi-pro'),
		'description' => __('Select Pages from the dropdown for video section','kidsi-pro'),
		'priority' => null,
		'panel' => 	'kidsi_pro_themeoptions_panel',          
	));		
		
	
	$wp_customize->add_setting('kidsi_pro_videopage',array(
		'default' => '0',			
		'capability' => 'edit_theme_options',
		'sanitize_callback' => 'kidsi_pro_sanitize_dropdown_pages'
	));
 
	$wp_customize->add_control(	'kidsi_pro_videopage',array(
		'type' => 'dropdown-pages',			
		'section' => 'kidsi_pro_video_section',
	));	
	
	
	//video section Excerpt Length
	$wp_customize->add_setting( 'kidsi_pro_videopage_excerptlength', array(
		'default'              => 40,
		'type'                 => 'theme_mod',		
		'sanitize_callback'    => 'kidsi_pro_sanitize_excerptrange',		
	) );
	$wp_customize->add_control( 'kidsi_pro_videopage_excerptlength', array(
		'label'       => __( 'welcome video text description length','kidsi-pro' ),
		'section'     => 'kidsi_pro_video_section',
		'type'        => 'range',
		'settings'    => 'kidsi_pro_videopage_excerptlength','input_attrs' => array(
			'step'             => 1,
			'min'              => 0,
			'max'              => 50,
		),
	) );
	
	
	$wp_customize->add_setting('kidsi_pro_youtubeid',array(
		'default' => null,
		'sanitize_callback' => 'sanitize_text_field'	
	));
	
	$wp_customize->add_control('kidsi_pro_youtubeid',array(	
		'type' => 'text',
		'label' => __('Enter here YouTube ID exa. 5Th5tggtz6k','kidsi-pro'),
		'section' => 'kidsi_pro_video_section',
		'setting' => 'kidsi_pro_youtubeid'
	)); //enter here YouTube ID
	
	
	$wp_customize->add_setting('kidsi_pro_show_video_section',array(
		'default' => false,
		'sanitize_callback' => 'kidsi_pro_sanitize_checkbox',
		'capability' => 'edit_theme_options',
	));	 
	
	$wp_customize->add_control( 'kidsi_pro_show_video_section', array(
	    'settings' => 'kidsi_pro_show_video_section',
	    'section'   => 'kidsi_pro_video_section',
	    'label'     => __('Check To Show This Section','kidsi-pro'),
	    'type'      => 'checkbox'
	));//Show Video sections
	 
	 
	 
	 //Four page Section
	$wp_customize->add_section('kidsi_pro_4columns_sections', array(
		'title' => __('Four Column Section','kidsi-pro'),
		'description' => __('Select pages from the dropdown for four column section','kidsi-pro'),
		'priority' => null,
		'panel' => 	'kidsi_pro_themeoptions_panel',          
	));	
	
	
	$wp_customize->add_setting('kidsi_pro_sectiontitle',array(
		'default' => null,
		'sanitize_callback' => 'sanitize_text_field'	
	));
	
	$wp_customize->add_control('kidsi_pro_sectiontitle',array(	
		'type' => 'text',
		'label' => __('write services title here','kidsi-pro'),
		'section' => 'kidsi_pro_4columns_sections',
		'setting' => 'kidsi_pro_sectiontitle'
	)); //write four cloumn title here	
	
	
	$wp_customize->add_setting('kidsi_pro_4columnsubtitle',array(
		'default' => null,
		'sanitize_callback' => 'sanitize_text_field'	
	));
	
	$wp_customize->add_control('kidsi_pro_4columnsubtitle',array(	
		'type' => 'text',
		'label' => __('write services sub title here','kidsi-pro'),
		'section' => 'kidsi_pro_4columns_sections',
		'setting' => 'kidsi_pro_4columnsubtitle'
	)); //write four cloumn sub title here	
	
		
	$wp_customize->add_setting('kidsi_pro_4columnpage1',array(
		'default' => '0',			
		'capability' => 'edit_theme_options',
		'sanitize_callback' => 'kidsi_pro_sanitize_dropdown_pages'
	));
 
	$wp_customize->add_control(	'kidsi_pro_4columnpage1',array(
		'type' => 'dropdown-pages',			
		'section' => 'kidsi_pro_4columns_sections',
	));		
	
	$wp_customize->add_setting('kidsi_pro_4columnpage2',array(
		'default' => '0',			
		'capability' => 'edit_theme_options',
		'sanitize_callback' => 'kidsi_pro_sanitize_dropdown_pages'
	));
 
	$wp_customize->add_control(	'kidsi_pro_4columnpage2',array(
		'type' => 'dropdown-pages',			
		'section' => 'kidsi_pro_4columns_sections',
	));
	
	$wp_customize->add_setting('kidsi_pro_4columnpage3',array(
		'default' => '0',			
		'capability' => 'edit_theme_options',
		'sanitize_callback' => 'kidsi_pro_sanitize_dropdown_pages'
	));
 
	$wp_customize->add_control(	'kidsi_pro_4columnpage3',array(
		'type' => 'dropdown-pages',			
		'section' => 'kidsi_pro_4columns_sections',
	));	
	
	$wp_customize->add_setting('kidsi_pro_4columnpage4',array(
		'default' => '0',			
		'capability' => 'edit_theme_options',
		'sanitize_callback' => 'kidsi_pro_sanitize_dropdown_pages'
	));
 
	$wp_customize->add_control(	'kidsi_pro_4columnpage4',array(
		'type' => 'dropdown-pages',			
		'section' => 'kidsi_pro_4columns_sections',
	));	

	$wp_customize->add_setting( 'kidsi_pro_4column_excerptlength', array(
		'default'              => 0,
		'type'                 => 'theme_mod',		
		'sanitize_callback'    => 'kidsi_pro_sanitize_excerptrange',		
	) );
	$wp_customize->add_control( 'kidsi_pro_4column_excerptlength', array(
		'label'       => __( 'four page box excerpt length','kidsi-pro' ),
		'section'     => 'kidsi_pro_4columns_sections',
		'type'        => 'range',
		'settings'    => 'kidsi_pro_4column_excerptlength','input_attrs' => array(
			'step'             => 1,
			'min'              => 0,
			'max'              => 50,
		),
	) );	
	
	$wp_customize->add_setting('kidsi_pro_4column_readmorebutton',array(
		'default' => null,
		'sanitize_callback' => 'sanitize_text_field'	
	));
	
	$wp_customize->add_control('kidsi_pro_4column_readmorebutton',array(	
		'type' => 'text',
		'label' => __('Read more button name here','kidsi-pro'),
		'section' => 'kidsi_pro_4columns_sections',
		'setting' => 'kidsi_pro_4column_readmorebutton'
	)); //four box read more button text
	
	
	$wp_customize->add_setting('kidsi_pro_show_4columns_sections',array(
		'default' => false,
		'sanitize_callback' => 'kidsi_pro_sanitize_checkbox',
		'capability' => 'edit_theme_options',
	));		
	
	$wp_customize->add_control( 'kidsi_pro_show_4columns_sections', array(
	   'settings' => 'kidsi_pro_show_4columns_sections',
	   'section'   => 'kidsi_pro_4columns_sections',
	   'label'     => __('Check To Show This Section','kidsi-pro'),
	   'type'      => 'checkbox'
	 ));//Show four column services sections
	 
	 
	 //Social icons Section
	$wp_customize->add_section('kidsi_pro_footersocial_settings',array(
		'title' => __('Footer Social icons','kidsi-pro'),
		'description' => __( 'Add social icons link here to display icons in footer ', 'kidsi-pro' ),			
		'priority' => null,
		'panel' => 	'kidsi_pro_themeoptions_panel', 
	));
	
	$wp_customize->add_setting('kidsi_pro_footfb_link',array(
		'default' => null,
		'sanitize_callback' => 'esc_url_raw'	
	));
	
	$wp_customize->add_control('kidsi_pro_footfb_link',array(
		'label' => __('Add facebook link here','kidsi-pro'),
		'section' => 'kidsi_pro_footersocial_settings',
		'setting' => 'kidsi_pro_footfb_link'
	));	
	
	$wp_customize->add_setting('kidsi_pro_foottw_link',array(
		'default' => null,
		'sanitize_callback' => 'esc_url_raw'
	));
	
	$wp_customize->add_control('kidsi_pro_foottw_link',array(
		'label' => __('Add twitter link here','kidsi-pro'),
		'section' => 'kidsi_pro_footersocial_settings',
		'setting' => 'kidsi_pro_foottw_link'
	));

	
	$wp_customize->add_setting('kidsi_pro_footin_link',array(
		'default' => null,
		'sanitize_callback' => 'esc_url_raw'
	));
	
	$wp_customize->add_control('kidsi_pro_footin_link',array(
		'label' => __('Add linkedin link here','kidsi-pro'),
		'section' => 'kidsi_pro_footersocial_settings',
		'setting' => 'kidsi_pro_footin_link'
	));
	
	$wp_customize->add_setting('kidsi_pro_footigram_link',array(
		'default' => null,
		'sanitize_callback' => 'esc_url_raw'
	));
	
	$wp_customize->add_control('kidsi_pro_footigram_link',array(
		'label' => __('Add instagram link here','kidsi-pro'),
		'section' => 'kidsi_pro_footersocial_settings',
		'setting' => 'kidsi_pro_footigram_link'
	));
	
	$wp_customize->add_setting('kidsi_pro_show_footersocial_settings',array(
		'default' => false,
		'sanitize_callback' => 'kidsi_pro_sanitize_checkbox',
		'capability' => 'edit_theme_options',
	));	 
	
	$wp_customize->add_control( 'kidsi_pro_show_footersocial_settings', array(
	   'settings' => 'kidsi_pro_show_footersocial_settings',
	   'section'   => 'kidsi_pro_footersocial_settings',
	   'label'     => __('Check To show This Section','kidsi-pro'),
	   'type'      => 'checkbox'
	 ));//Show Footer Social settings
	 
	 
	 //Blog Posts Settings
	$wp_customize->add_panel( 'kidsi_pro_blogsettings_panel', array(
		'priority' => 3,
		'capability' => 'edit_theme_options',
		'theme_supports' => '',
		'title' => __( 'Blog Posts Settings', 'kidsi-pro' ),		
	) );
	
	$wp_customize->add_section('kidsi_pro_blogmeta_options',array(
		'title' => __('Blog Meta Options','kidsi-pro'),			
		'priority' => null,
		'panel' => 	'kidsi_pro_blogsettings_panel', 	         
	));		
	
	$wp_customize->add_setting('kidsi_pro_hide_blogdate',array(
		'sanitize_callback' => 'kidsi_pro_sanitize_checkbox',
	));	 

	$wp_customize->add_control( 'kidsi_pro_hide_blogdate', array(
    	'label' => __('Check to hide post date','kidsi-pro'),	
		'section'   => 'kidsi_pro_blogmeta_options', 
		'setting' => 'kidsi_pro_hide_blogdate',		
    	'type'      => 'checkbox'
     )); //Blog Date
	 
	 
	 $wp_customize->add_setting('kidsi_pro_hide_postcats',array(
		'sanitize_callback' => 'kidsi_pro_sanitize_checkbox',
	));	 

	$wp_customize->add_control( 'kidsi_pro_hide_postcats', array(
		'label' => __('Check to hide post category','kidsi-pro'),	
    	'section'   => 'kidsi_pro_blogmeta_options',		
		'setting' => 'kidsi_pro_hide_postcats',		
    	'type'      => 'checkbox'
     )); //blogposts category	 
	 
	 
	 $wp_customize->add_section('kidsi_pro_postfeatured_image',array(
		'title' => __('Posts Featured image','kidsi-pro'),			
		'priority' => null,
		'panel' => 	'kidsi_pro_blogsettings_panel', 	         
	));		
	
	$wp_customize->add_setting('kidsi_pro_hide_postfeatured_image',array(
		'sanitize_callback' => 'kidsi_pro_sanitize_checkbox',
	));	 

	$wp_customize->add_control( 'kidsi_pro_hide_postfeatured_image', array(
		'label' => __('Check to hide post featured image','kidsi-pro'),
    	'section'   => 'kidsi_pro_postfeatured_image',		
		'setting' => 'kidsi_pro_hide_postfeatured_image',	
    	'type'      => 'checkbox'
     )); //Posts featured image
	 
	 
	 $wp_customize->add_setting('kidsi_pro_postimg_left30',array(
		'sanitize_callback' => 'kidsi_pro_sanitize_checkbox',
	));	 

	$wp_customize->add_control( 'kidsi_pro_postimg_left30', array(
		'label' => __('Check to featured image Left Align','kidsi-pro'),
    	'section'   => 'kidsi_pro_postfeatured_image',		
		'setting' => 'kidsi_pro_postimg_left30',	
    	'type'      => 'checkbox'
     )); //posts featured images30
	 
	  
	 $wp_customize->add_section('kidsi_pro_postmorebtn',array(
		'title' => __('Posts Read More Button','kidsi-pro'),			
		'priority' => null,
		'panel' => 	'kidsi_pro_blogsettings_panel', 	         
	 ));	
	 
	 $wp_customize->add_setting('kidsi_pro_postmorebuttontext',array(
		'default' => null,
		'sanitize_callback' => 'sanitize_text_field'	
	)); //blog read more button text
	
	$wp_customize->add_control('kidsi_pro_postmorebuttontext',array(	
		'type' => 'text',
		'label' => __('Read more button text for blog posts','kidsi-pro'),
		'section' => 'kidsi_pro_postmorebtn',
		'setting' => 'kidsi_pro_postmorebuttontext'
	)); //Post read more button text	
	
	$wp_customize->add_section('kidsi_pro_postcontent_settings',array(
		'title' => __('Posts Excerpt Options','kidsi-pro'),			
		'priority' => null,
		'panel' => 	'kidsi_pro_blogsettings_panel', 	         
	 ));	 
	 
	$wp_customize->add_setting( 'kidsi_pro_postexcerptrange', array(
		'default'              => 30,
		'type'                 => 'theme_mod',
		'transport' 		   => 'refresh',
		'sanitize_callback'    => 'kidsi_pro_sanitize_excerptrange',		
	) );
	
	$wp_customize->add_control( 'kidsi_pro_postexcerptrange', array(
		'label'       => __( 'Excerpt length','kidsi-pro' ),
		'section'     => 'kidsi_pro_postcontent_settings',
		'type'        => 'range',
		'settings'    => 'kidsi_pro_postexcerptrange','input_attrs' => array(
			'step'             => 1,
			'min'              => 0,
			'max'              => 50,
		),
	) );

    $wp_customize->add_setting('kidsi_pro_postsfullcontent_options',array(
        'default' => 'Excerpt',     
        'sanitize_callback' => 'kidsi_pro_sanitize_choices'
	));
	
	$wp_customize->add_control('kidsi_pro_postsfullcontent_options',array(
        'type' => 'select',
        'label' => __('Posts Content','kidsi-pro'),
        'section' => 'kidsi_pro_postcontent_settings',
        'choices' => array(
        	'Content' => __('Content','kidsi-pro'),
            'Excerpt' => __('Excerpt','kidsi-pro'),
            'No Content' => __('No Excerpt','kidsi-pro')
        ),
	) ); 
	
	
	$wp_customize->add_section('kidsi_pro_postsinglemeta',array(
		'title' => __('Posts Single Settings','kidsi-pro'),			
		'priority' => null,
		'panel' => 	'kidsi_pro_blogsettings_panel', 	         
	));	
	
	$wp_customize->add_setting('kidsi_pro_hide_postdate_fromsingle',array(
		'sanitize_callback' => 'kidsi_pro_sanitize_checkbox',
	));	 

	$wp_customize->add_control( 'kidsi_pro_hide_postdate_fromsingle', array(
    	'label' => __('Check to hide post date from single','kidsi-pro'),	
		'section'   => 'kidsi_pro_postsinglemeta', 
		'setting' => 'kidsi_pro_hide_postdate_fromsingle',		
    	'type'      => 'checkbox'
     )); //Hide Posts date from single
	 
	 
	 $wp_customize->add_setting('kidsi_pro_hide_postcats_fromsingle',array(
		'sanitize_callback' => 'kidsi_pro_sanitize_checkbox',
	));	 

	$wp_customize->add_control( 'kidsi_pro_hide_postcats_fromsingle', array(
		'label' => __('Check to hide post category from single','kidsi-pro'),	
    	'section'   => 'kidsi_pro_postsinglemeta',		
		'setting' => 'kidsi_pro_hide_postcats_fromsingle',		
    	'type'      => 'checkbox'
     )); //Hide blogposts category single
	 
	 
	 //Sidebar Settings
	$wp_customize->add_section('kidsi_pro_sidebarsettings', array(
		'title' => __('Sidebar Settings','kidsi-pro'),		
		'priority' => null,
		'panel' => 	'kidsi_pro_blogsettings_panel',          
	));		
	 
	$wp_customize->add_setting('kidsi_pro_hidesidebar_blogposts',array(
		'default' => false,
		'sanitize_callback' => 'kidsi_pro_sanitize_checkbox',
		'capability' => 'edit_theme_options',
	));	 
	
	$wp_customize->add_control( 'kidsi_pro_hidesidebar_blogposts', array(
	   'settings' => 'kidsi_pro_hidesidebar_blogposts',
	   'section'   => 'kidsi_pro_sidebarsettings',
	   'label'     => __('Check to hide sidebar from homepage','kidsi-pro'),
	   'type'      => 'checkbox'
	 ));//hide sidebar blog posts 
	
		 
	 $wp_customize->add_setting('kidsi_pro_hidesidebar_singleposts',array(
		'default' => false,
		'sanitize_callback' => 'kidsi_pro_sanitize_checkbox',
		'capability' => 'edit_theme_options',
	));	 
	
	$wp_customize->add_control( 'kidsi_pro_hidesidebar_singleposts', array(
	   'settings' => 'kidsi_pro_hidesidebar_singleposts',
	   'section'   => 'kidsi_pro_sidebarsettings',
	   'label'     => __('Check to hide sidebar from single post','kidsi-pro'),
	   'type'      => 'checkbox'
	 ));// Hide sidebar single post	 
		 
}
add_action( 'customize_register', 'kidsi_pro_customize_register' );

function kidsi_pro_custom_css(){ 
?>
	<style type="text/css"> 					
        a,
        #sidebar ul li a:hover,
		#sidebar ol li a:hover,							
        .Bpostsbxstyle h3 a:hover,		
        .postmeta a:hover,
		h4.sub_title,			 			
        .button:hover,
		.sr-column-25:hover h4 a,		
		h2.services_title span,			
		.blog_postmeta a:hover,
		.blog_postmeta a:focus,
		.site-footer ul li a:hover, 
		.site-footer ul li.current_page_item a,
		.videobox .playbtn:after,
		blockquote::before	
            { color:<?php echo esc_html( get_theme_mod('kidsi_pro_oneclick_colorcode','#812570')); ?>;}					 
            
        .pagination ul li .current, .pagination ul li a:hover, 
        #commentform input#submit:hover,		
        .nivo-controlNav a.active,
		.sd-search input, .sd-top-bar-nav .sd-search input,			
		a.blogreadmore,
		.hdr-logo-menu,
		.site-hdrmenu .menu ul,
		a.servicesemore,
		.nivo-caption .slidermorebtn:hover,
		.learnmore:hover,		
		.copyrigh-wrapper:before,										
        #sidebar .search-form input.search-submit,				
        .wpcf7 input[type='submit'],				
        nav.pagination .page-numbers.current,		
		.morebutton,	
		.nivo-directionNav a:hover,	
        .toggle a,		
		.footericons a:hover,
		.sr-column-25:hover a.morebtnstyle2:after			
            { background-color:<?php echo esc_html( get_theme_mod('kidsi_pro_oneclick_colorcode','#812570')); ?>;}
			
		
		.tagcloud a:hover,
		.video_description,
		blockquote
            { border-color:<?php echo esc_html( get_theme_mod('kidsi_pro_oneclick_colorcode','#812570')); ?>;}			
			
		#SiteWrapper a:focus,
		button:focus,
		input[type="text"]:focus,
		input[type="email"]:focus,
		input[type="range"]:focus,
		input[type="date"]:focus,
		input[type="search"]:focus,
		input[type="number"]:focus,
		input[type="tel"]:focus,
		input[type="button"]:focus,
		input[type="month"]:focus,
		input[type="password"]:focus,
		input[type="datetime"]:focus,
		input[type="week"]:focus,
		input[type="submit"]:focus,
		input[type="datetime-local"]:focus,
		input[type="time"]:focus,
		input[type="url"]:focus,
		input[type="reset"]:focus,
		input[type="color"]:focus,
		textarea:focus
            { outline:thin dotted <?php echo esc_html( get_theme_mod('kidsi_pro_oneclick_colorcode','#812570')); ?>;}	
			
		
		.site-hdrmenu a,
		.site-hdrmenu ul li.current_page_parent ul.sub-menu li a,
		.site-hdrmenu ul li.current_page_parent ul.sub-menu li.current_page_item ul.sub-menu li a,
		.site-hdrmenu ul li.current-menu-ancestor ul.sub-menu li.current-menu-item ul.sub-menu li a  			
            { color:<?php echo esc_html( get_theme_mod('kidsi_pro_menucolor','#ffffff')); ?>;}	
			
		
		.site-hdrmenu .menu a:hover,
		.site-hdrmenu .menu a:focus,
		.site-hdrmenu .menu ul a:hover,
		.site-hdrmenu .menu ul a:focus,
		.site-hdrmenu ul li a:hover, 
		.site-hdrmenu ul li.current-menu-item a,			
		.site-hdrmenu ul li.current_page_parent ul.sub-menu li.current-menu-item a,
		.site-hdrmenu ul li.current_page_parent ul.sub-menu li a:hover,
		.site-hdrmenu ul li.current-menu-item ul.sub-menu li a:hover,
		.site-hdrmenu ul li.current-menu-ancestor ul.sub-menu li.current-menu-item ul.sub-menu li a:hover 	 			
            { color:<?php echo esc_html( get_theme_mod('kidsi_pro_menuactive','#000000')); ?>;}					
							
	
    </style> 
<?php                                                                                                                                                       
}
         
add_action('wp_head','kidsi_pro_custom_css');	 

/**
 * Binds JS handlers to make Theme Customizer preview reload changes asynchronously.
 */
function kidsi_pro_customize_preview_js() {
	wp_enqueue_script( 'kidsi_pro_customizer', get_template_directory_uri() . '/js/customize-preview.js', array( 'customize-preview' ), '19062019', true );
}
add_action( 'customize_preview_init', 'kidsi_pro_customize_preview_js' );