<?php
function carpenterservice_blog_setting( $wp_customize ) {
$selective_refresh = isset( $wp_customize->selective_refresh ) ? 'postMessage' : 'refresh';
	$wp_customize->add_panel(
		'carpenterservice_frontpage_sections', array(
			'priority' => 32,
			'title' => esc_html__( 'Frontpage Sections', 'carpenter-service' ),
		)  
	);
	


	/*=========================================
	Slider Section
	=========================================*/
	$wp_customize->add_section(
		'slider_setting', array(
			'title' => esc_html__( 'Slider Section', 'carpenter-service' ),
			'description'=> __('<a>Note :</a> Image Size Should Be 1500*800','carpenter-service'),
			'priority' => 1,
			'panel' => 'carpenterservice_frontpage_sections',
		)
	);



	$wp_customize->add_setting('carpenterservice_slider_tabs', array(
	   'sanitize_callback' => 'wp_kses_post',
	));

	$wp_customize->add_control(new carpenterservice_Tab_Control($wp_customize, 'carpenterservice_slider_tabs', array(
	   'section' => 'slider_setting',
	   'priority' => 2,
	   'buttons' => array(
	      array(
         	'name' => esc_html__('General', 'carpenter-service'),
            'icon' => 'dashicons dashicons-welcome-write-blog',
            'fields' => array(
				'slider_disable_section',
            	'slider1',
            	'slider2',
            	'slider3',
            	'slider4',
            	'slider5',
            	'slider6',
				'slider_btntext',
				'slider_bannertext',
				'slider_slideraboutustext',
				'slider_slideraboutuslink'
            ),
            'active' => true,
         ), 
	      array(
            'name' => esc_html__('Style', 'carpenter-service'),
        	'icon' => 'dashicons dashicons-art',
            'fields' => array(
                'slider_titlecolor',
                'slider_descriptioncolor',
                'slider_btntxt1color',
				'slider_btntxt1brdcolor',
				'slider_btntxthovercolor',
				'slider_Arrowcolor',
				'slider_ArrowBGcolor',
				'slider_ArrowBGHovercolor',
				'slider_bannerbgcolor',
				'slider_bannertextcolor',
				'slider_bannerbtntextcolor',
				'slider_bannerbtnbgcolor',

            ),
     	),
		 array(
		   'name' => esc_html__('Layout', 'carpenter-service'),
		   'icon' => 'dashicons dashicons-layout',
		   'fields' => array(
			   'slider_section_width',
			   'carpenterservice_slider_padding',
			   'carpenter_slider_top_padding',
			   'carpenter_slider_bottom_padding'
		   ),
		)
	    
    	),
	))); 

	

	// General Tab

	// hide show slider section
	$wp_customize->add_setting(
        'slider_disable_section',
        array(
            'sanitize_callback' => 'wp_kses_post',
        )
    ); 
    $wp_customize->add_control(
        new carpenterservice_Toggle_Switch_Custom_Control(
            $wp_customize,
            'slider_disable_section',
            array(
                'settings'      => 'slider_disable_section',
                'section'       => 'slider_setting',
                'label'         => __( 'Hide Content', 'carpenter-service' ),
                'on_off_label'  => array(
                    'on' => __( 'Yes', 'carpenter-service' ),
                    'off' => __( 'No', 'carpenter-service' )
                ),
            )
        )
    );


	// Slider 1
	$wp_customize->add_setting( 
    	'slider1',
    	array(
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'slider1',
		array(
		    'label'   		=> __('Slider 1','carpenter-service'),
		    'section'		=> 'slider_setting',
			'type' 			=> 'dropdown-pages',
			'transport'         => $selective_refresh,
		)  
	);		



	// Slider 2
	$wp_customize->add_setting(
    	'slider2',
    	array(
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 4,
		)
	);	

	$wp_customize->add_control( 
		'slider2',
		array(
		    'label'   		=> __('Slider 2','carpenter-service'),
		    'section'		=> 'slider_setting',
			'type' 			=> 'dropdown-pages',
			'transport'         => $selective_refresh,
		)  
	);	


	// Slider 3
	$wp_customize->add_setting(
    	'slider3',
    	array(
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 5,
		)
	);	

	$wp_customize->add_control( 
		'slider3',
		array(
		    'label'   		=> __('Slider 3','carpenter-service'),
		    'section'		=> 'slider_setting',
			'type' 			=> 'dropdown-pages',
			'transport'         => $selective_refresh,
		)  
	);	


	// Slider 4
	$wp_customize->add_setting(
    	'slider4',
    	array(
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 6,
		)
	);	

	$wp_customize->add_control( 
		'slider4',
		array(
		    'label'   		=> __('Slider 4','carpenter-service'),
		    'section'		=> 'slider_setting',
			'type' 			=> 'dropdown-pages',
			'transport'         => $selective_refresh,
		)  
	);



	// Slider 5
	$wp_customize->add_setting(
    	'slider5',
    	array(
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 7,
		)
	);	

	$wp_customize->add_control( 
		'slider5',
		array(
		    'label'   		=> __('Slider 5','carpenter-service'),
		    'section'		=> 'slider_setting',
			'type' 			=> 'dropdown-pages',
			'transport'         => $selective_refresh,
		)  
	);

	// Slider 6
	$wp_customize->add_setting(
    	'slider6',
    	array(
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 7,
		)
	);	

	$wp_customize->add_control( 
		'slider6',
		array(
		    'label'   		=> __('Slider 6','carpenter-service'),
		    'section'		=> 'slider_setting',
			'type' 			=> 'dropdown-pages',
			'transport'         => $selective_refresh,
		)  
	);

	// slider btntext
	$sliderbtntext = esc_html__('Read More', 'carpenter-service' );
	$wp_customize->add_setting(
    	'slider_btntext',
    	array(
			'default' => $sliderbtntext,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 6,
		)
	);	

	$wp_customize->add_control( 
		'slider_btntext',
		array(
		    'label'   		=> __('Button Text','carpenter-service'),
		    'section'		=> 'slider_setting',
			'type' 			=> 'text',
			'transport'         => $selective_refresh,
		)  
	);


	// slider banner
	$sliderbannertext = esc_html__('Describe your business can help slove the visitor problems', 'carpenter-service' );
	$wp_customize->add_setting(
    	'slider_bannertext',
    	array(
			'default' => $sliderbannertext,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 6,
		)
	);	

	$wp_customize->add_control( 
		'slider_bannertext',
		array(
		    'label'   		=> __('Banner Text','carpenter-service'),
		    'section'		=> 'slider_setting',
			'type' 			=> 'text',
			'transport'         => $selective_refresh,
		)  
	);


	// slider banner button text
	$sliderslideraboutustext = esc_html__('About Us', 'carpenter-service' );
	$wp_customize->add_setting(
    	'slider_slideraboutustext',
    	array(
			'default' => $sliderslideraboutustext,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 6,
		)
	);	

	$wp_customize->add_control( 
		'slider_slideraboutustext',
		array(
		    'label'   		=> __('Banner Button Text','carpenter-service'),
		    'section'		=> 'slider_setting',
			'type' 			=> 'text',
			'transport'         => $selective_refresh,
		)  
	);


	// slider banner button link
	$sliderslideraboutuslink = esc_html__('#', 'carpenter-service' );
	$wp_customize->add_setting(
    	'slider_slideraboutuslink',
    	array(
			'default' => $sliderslideraboutuslink,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 6,
		)
	);	

	$wp_customize->add_control( 
		'slider_slideraboutuslink',
		array(
		    'label'   		=> __('Banner Button Link','carpenter-service'),
		    'section'		=> 'slider_setting',
			'type' 			=> 'text',
			'transport'         => $selective_refresh,
		)  
	);

	

	// Style setting

	// slider title Color
	$slidertitlecolor = esc_html__('#fff', 'carpenter-service' );
	$wp_customize->add_setting(
    	'slider_titlecolor',
    	array(
			'default' => $slidertitlecolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'slider_titlecolor',
		array(
		    'label'   		=> __('Title Color','carpenter-service'),
		    'section'		=> 'slider_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);


	// slider description Color
	$sliderdescriptioncolor = esc_html__('#fff', 'carpenter-service' );
	$wp_customize->add_setting(
    	'slider_descriptioncolor',
    	array(
			'default' => $sliderdescriptioncolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'slider_descriptioncolor',
		array(
		    'label'   		=> __('Description Color','carpenter-service'),
		    'section'		=> 'slider_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// slider btntxt1 Color
	$sliderbtntxt1color = esc_html__('#fff', 'carpenter-service' );
	$wp_customize->add_setting(
    	'slider_btntxt1color',
    	array(
			'default' => $sliderbtntxt1color,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'slider_btntxt1color',
		array(
		    'label'   		=> __('Button Text Color','carpenter-service'),
		    'section'		=> 'slider_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// slider btntxt1brd Color
	$sliderbtntxt1brdcolor = esc_html__('#fff', 'carpenter-service' );
	$wp_customize->add_setting(
    	'slider_btntxt1brdcolor',
    	array(
			'default' => $sliderbtntxt1brdcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'slider_btntxt1brdcolor',
		array(
		    'label'   		=> __('Button Border Color','carpenter-service'),
		    'section'		=> 'slider_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	
	// slider btntxthover Color
	$sliderbtntxthovercolor = esc_html__('#d2ae96', 'carpenter-service' );
	$wp_customize->add_setting(
    	'slider_btntxthovercolor',
    	array(
			'default' => $sliderbtntxthovercolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'slider_btntxthovercolor',
		array(
		    'label'   		=> __('Button Text Hover Color','carpenter-service'),
		    'section'		=> 'slider_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);



		// slider Arrow Color
	$sliderArrowcolor = esc_html__('#000', 'carpenter-service' );
	$wp_customize->add_setting(
    	'slider_Arrowcolor',
    	array(
			'default' => $sliderArrowcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'slider_Arrowcolor',
		array(
		    'label'   		=> __('Slider Arrow Color','carpenter-service'),
		    'section'		=> 'slider_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);



// slider Arrow BG Color
	$sliderArrowBGcolor = esc_html__('#fff', 'carpenter-service' );
	$wp_customize->add_setting(
    	'slider_ArrowBGcolor',
    	array(
			'default' => $sliderArrowBGcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'slider_ArrowBGcolor',
		array(
		    'label'   		=> __('Slider Arrow BG Color','carpenter-service'),
		    'section'		=> 'slider_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);


// slider Arrow BG Hover Color
	$sliderArrowBGHovercolor = esc_html__('#d2ae96', 'carpenter-service' );
	$wp_customize->add_setting(
    	'slider_ArrowBGHovercolor',
    	array(
			'default' => $sliderArrowBGHovercolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'slider_ArrowBGHovercolor',
		array(
		    'label'   		=> __('Slider Arrow Hover BG Color','carpenter-service'),
		    'section'		=> 'slider_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// slider bannerbg Color
	$sliderbannerbgcolor = esc_html__('#7C4B2A', 'carpenter-service' );
	$wp_customize->add_setting(
    	'slider_bannerbgcolor',
    	array(
			'default' => $sliderbannerbgcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'slider_bannerbgcolor',
		array(
		    'label'   		=> __('Banner BG Color','carpenter-service'),
		    'section'		=> 'slider_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// slider bannertext Color
	$sliderbannertextcolor = esc_html__('#fff', 'carpenter-service' );
	$wp_customize->add_setting(
    	'slider_bannertextcolor',
    	array(
			'default' => $sliderbannertextcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'slider_bannertextcolor',
		array(
		    'label'   		=> __('Banner Text Color','carpenter-service'),
		    'section'		=> 'slider_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// slider bannerbtntext Color
	$sliderbannerbtntextcolor = esc_html__('#7C4B2A', 'carpenter-service' );
	$wp_customize->add_setting(
    	'slider_bannerbtntextcolor',
    	array(
			'default' => $sliderbannerbtntextcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'slider_bannerbtntextcolor',
		array(
		    'label'   		=> __('Banner Button Text Color','carpenter-service'),
		    'section'		=> 'slider_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// slider bannerbtnbg Color
	$sliderbannerbtnbgcolor = esc_html__('#fff', 'carpenter-service' );
	$wp_customize->add_setting(
    	'slider_bannerbtnbgcolor',
    	array(
			'default' => $sliderbannerbtnbgcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'slider_bannerbtnbgcolor',
		array(
		    'label'   		=> __('Banner Button BG Color','carpenter-service'),
		    'section'		=> 'slider_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

 
	// layout setting
	$wp_customize->add_setting('slider_section_width',array(
        'default' => 'Full Width',
        'sanitize_callback' => 'carpenterservice_sanitize_choices',
    ));
    $wp_customize->add_control('slider_section_width',array(
        'type' => 'select',
        'label' => __('Section Width','carpenter-service'),
        'choices' => array (
            'Box Width' => __('Box Width','carpenter-service'),
            'Full Width' => __('Full Width','carpenter-service')
        ),
        'section' => 'slider_setting',
    ));



 // slider section padding 
	$wp_customize->add_setting('carpenterservice_slider_padding',array(
      'sanitize_callback'   => 'esc_html'
    ));
    $wp_customize->add_control('carpenterservice_slider_padding',array(
      'label' => __('Section Padding','carpenter-service'),
      'section' => 'slider_setting'
    ));

    $wp_customize->add_setting('carpenter_slider_top_padding',array(
        'default' => '0',
        'sanitize_callback' => 'sanitize_text_field'
    ));
    $wp_customize->add_control('carpenter_slider_top_padding',array(
	    'type' => 'number',
	    'label' => __('Top','carpenter-service'),
	    'section' => 'slider_setting',
    ));

 	$wp_customize->add_setting('carpenter_slider_bottom_padding',array(
        'default' => '0',
        'sanitize_callback' => 'sanitize_text_field'
    ));
    $wp_customize->add_control('carpenter_slider_bottom_padding',array(
	    'type' => 'number',
	    'label' => __('Bottom','carpenter-service'),
	    'section' => 'slider_setting',
    ));



	
	/*=========================================
	Service Section
	=========================================*/
	$wp_customize->add_section(
		'Service_setting', array(
			'title' => esc_html__( 'Service Section', 'carpenter-service' ),
			'priority' => 2,
			'panel' => 'carpenterservice_frontpage_sections',
		)
	);



	$wp_customize->add_setting('carpenterservice_Service_tabs', array(
	   'sanitize_callback' => 'wp_kses_post',
	));

	$wp_customize->add_control(new carpenterservice_Tab_Control($wp_customize, 'carpenterservice_Service_tabs', array(
	   'section' => 'Service_setting',
	   'priority' => 2,
	   'buttons' => array(
	      array(
         	'name' => esc_html__('General', 'carpenter-service'),
            'icon' => 'dashicons dashicons-welcome-write-blog',
            'fields' => array(
            	'service_disable_section',
				'service_subheading',
            	'service_heading',
            	'Service1',
            	'Service2',
            	'Service3',
            	'Service4',
            	'Service5',
            	'Service6',
				'service_btntext'
            ),
            'active' => true,
         ),
	      array(
            'name' => esc_html__('Style', 'carpenter-service'),
        	'icon' => 'dashicons dashicons-art',
            'fields' => array(
            	'service_subheadingcolor',
            	'service_headingcolor',
            	'service_boxtitlecolorcolor',
            	'service_boxdescriptioncolorcolor',
            	'service_buttontextcolor'
            ),
     	),
  		array(
	        'name' => esc_html__('Layout', 'carpenter-service'),
	        'icon' => 'dashicons dashicons-layout',
	        'fields' => array(
	            'carpenter_service_service_section_width',
	            'carpenterservice_service_padding',
	            'carpenter_service_service_top_padding',
	            'carpenter_service_service_bottom_padding',
				'carpenter_service_service_image_height'
	        ),
     	)
	    
    	),
	))); 



	// General

	// hide show service section
	$wp_customize->add_setting(
        'service_disable_section',
        array(
            'sanitize_callback' => 'wp_kses_post',
        )
    ); 
    $wp_customize->add_control(
        new carpenterservice_Toggle_Switch_Custom_Control(
            $wp_customize,
            'service_disable_section',
            array(
                'settings'      => 'service_disable_section',
                'section'       => 'Service_setting',
                'label'         => __( 'Disable Section', 'carpenter-service' ),
                'on_off_label'  => array(
                    'on' => __( 'Yes', 'carpenter-service' ),
                    'off' => __( 'No', 'carpenter-service' )
                ),
            )
        )
    );


    // service title
	$wp_customize->add_setting(
    	'service_heading',
    	array(
			'default' => '',
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 1,
		)
	);	

	$wp_customize->add_control( 
		'service_heading',
		array(
		    'label'   		=> __('Heading','carpenter-service'),
		    'section'		=> 'Service_setting',
			'type' 			=> 'text',
			'transport'         => $selective_refresh,
		)  
	);	

	 // service title
	$wp_customize->add_setting(
    	'service_heading',
    	array(
			'default' => '',
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 1,
		)
	);	

	$wp_customize->add_control( 
		'service_heading',
		array(
		    'label'   		=> __('Heading','carpenter-service'),
		    'section'		=> 'Service_setting',
			'type' 			=> 'text',
			'transport'         => $selective_refresh,
		)  
	);	

	 // service title
	 $wp_customize->add_setting(
    	'service_subheading',
    	array(
			'default' => '',
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 1,
		)
	);	

	$wp_customize->add_control( 
		'service_subheading',
		array(
		    'label'   		=> __('SubHeading','carpenter-service'),
		    'section'		=> 'Service_setting',
			'type' 			=> 'text',
			'transport'         => $selective_refresh,
		)  
	);	

	// Service 1
	$wp_customize->add_setting( 
    	'Service1',
    	array(
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 1,
		)
	);	

	$wp_customize->add_control( 
		'Service1',
		array(
		    'label'   		=> __('Service 1','carpenter-service'),
		    'section'		=> 'Service_setting',
			'type' 			=> 'dropdown-pages',
			'transport'         => $selective_refresh,
		)  
	);		

	// Service 2
	$wp_customize->add_setting(
    	'Service2',
    	array(
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 2,
		)
	);	

	$wp_customize->add_control( 
		'Service2',
		array(
		    'label'   		=> __('Service 2','carpenter-service'),
		    'section'		=> 'Service_setting',
			'type' 			=> 'dropdown-pages',
			'transport'         => $selective_refresh,
		)  
	);	


	// Service 3
	$wp_customize->add_setting(
    	'Service3',
    	array(
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'Service3',
		array(
		    'label'   		=> __('Service 3','carpenter-service'),
		    'section'		=> 'Service_setting',
			'type' 			=> 'dropdown-pages',
			'transport'         => $selective_refresh,
		)  
	);	


	// Service 4
	$wp_customize->add_setting(
    	'Service4',
    	array(
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 4,
		)
	);	

	$wp_customize->add_control( 
		'Service4',
		array(
		    'label'   		=> __('Service 4','carpenter-service'),
		    'section'		=> 'Service_setting',
			'type' 			=> 'dropdown-pages',
			'transport'         => $selective_refresh,
		)  
	);


	// Service 5
	$wp_customize->add_setting(
    	'Service5',
    	array(
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 5,
		)
	);	

	$wp_customize->add_control( 
		'Service5',
		array(
		    'label'   		=> __('Service 5','carpenter-service'),
		    'section'		=> 'Service_setting',
			'type' 			=> 'dropdown-pages',
			'transport'         => $selective_refresh,
		)  
	);


	// Service 6
	$wp_customize->add_setting(
    	'Service6',
    	array(
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 5,
		)
	);	

	$wp_customize->add_control( 
		'Service6',
		array(
		    'label'   		=> __('Service 6','carpenter-service'),
		    'section'		=> 'Service_setting',
			'type' 			=> 'dropdown-pages',
			'transport'         => $selective_refresh,
		)  
	);


	 // service btntext
	 $wp_customize->add_setting(
    	'service_btntext',
    	array(
			'default' => 'Read More',
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 1,
		)
	);	

	$wp_customize->add_control( 
		'service_btntext',
		array(
		    'label'   		=> __('Button Text','carpenter-service'),
		    'section'		=> 'Service_setting',
			'type' 			=> 'text',
			'transport'         => $selective_refresh,
		)  
	);	



	// style

	// service subheadingcolor color
	$servicesubheadingcolor = esc_html__('#707070', 'carpenter-service' );
	$wp_customize->add_setting(
    	'service_subheadingcolor',
    	array(
			'default' => $servicesubheadingcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 4,
		)
	);	

	$wp_customize->add_control( 
		'service_subheadingcolor',
		array(
		    'label'   		=> __('SubHeading Color','carpenter-service'),
		    'section'		=> 'Service_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// service headingcolor color
	$serviceheadingcolor = esc_html__('#000', 'carpenter-service' );
	$wp_customize->add_setting(
    	'service_headingcolor',
    	array(
			'default' => $serviceheadingcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 4,
		)
	);	

	$wp_customize->add_control( 
		'service_headingcolor',
		array(
		    'label'   		=> __('Heading Color','carpenter-service'),
		    'section'		=> 'Service_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);


	// service boxtitlecolor color
	$serviceboxtitlecolorcolor = esc_html__('#000', 'carpenter-service' );
	$wp_customize->add_setting(
    	'service_boxtitlecolorcolor',
    	array(
			'default' => $serviceboxtitlecolorcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 4,
		)
	);	

	$wp_customize->add_control( 
		'service_boxtitlecolorcolor',
		array(
		    'label'   		=> __('Title Color','carpenter-service'),
		    'section'		=> 'Service_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// service boxdescriptioncolor color
	$serviceboxdescriptioncolorcolor = esc_html__('#8c8c8f', 'carpenter-service' );
	$wp_customize->add_setting(
    	'service_boxdescriptioncolorcolor',
    	array(
			'default' => $serviceboxdescriptioncolorcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 4,
		)
	);	

	$wp_customize->add_control( 
		'service_boxdescriptioncolorcolor',
		array(
		    'label'   		=> __('Description Color','carpenter-service'),
		    'section'		=> 'Service_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);


	// service buttontext color
	$servicebuttontextcolor = esc_html__('#fff', 'carpenter-service' );
	$wp_customize->add_setting(
    	'service_buttontextcolor',
    	array(
			'default' => $servicebuttontextcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 4,
		)
	);	

	$wp_customize->add_control( 
		'service_buttontextcolor',
		array(
		    'label'   		=> __('Button Text Color','carpenter-service'),
		    'section'		=> 'Service_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);



	// layout setting
	$wp_customize->add_setting('carpenter_service_service_section_width',array(
        'default' => 'Box Width',
        'sanitize_callback' => 'carpenterservice_sanitize_choices',
    ));
    $wp_customize->add_control('carpenter_service_service_section_width',array(
        'type' => 'select',
        'label' => __('Section Width','carpenter-service'),
        'choices' => array (
            'Box Width' => __('Box Width','carpenter-service'),
            'Full Width' => __('Full Width','carpenter-service')
        ),
        'section' => 'Service_setting',
    ));


    // service section padding 
	$wp_customize->add_setting('carpenterservice_service_padding',array(
      'sanitize_callback'   => 'esc_html'
    ));
    $wp_customize->add_control('carpenterservice_service_padding',array(
      'label' => __('Section Padding','carpenter-service'),
      'section' => 'Service_setting'
    ));

    $wp_customize->add_setting('carpenter_service_service_top_padding',array(
        'default' => '5',
        'sanitize_callback' => 'sanitize_text_field'
    ));
    $wp_customize->add_control('carpenter_service_service_top_padding',array(
	    'type' => 'number',
	    'label' => __('Top','carpenter-service'),
	    'section' => 'Service_setting',
    ));

 	$wp_customize->add_setting('carpenter_service_service_bottom_padding',array(
        'default' => '2',
        'sanitize_callback' => 'sanitize_text_field'
    ));
    $wp_customize->add_control('carpenter_service_service_bottom_padding',array(
	    'type' => 'number',
	    'label' => __('Bottom','carpenter-service'),
	    'section' => 'Service_setting',
    ));


	// service img height
    $wp_customize->add_setting('carpenter_service_service_image_height',array(
        'default' => 250,
        'sanitize_callback' => 'carpenterservice_sanitize_float'
    ));
    $wp_customize->add_control(new carpenterservice_Custom_Control( $wp_customize, 'carpenter_service_service_image_height',array(
	    'label' => __('Image Height','carpenter-service'),
	    'section' => 'Service_setting',
	    'input_attrs' => array(
	            'min' => 0,
	            'max' => 500,
	            'step' => 1,
	        ),
    )));



    /*=========================================
	Blog Section
	=========================================*/
	$wp_customize->add_section(
		'blog_setting', array(
			'title' => esc_html__( 'Blog Section', 'carpenter-service' ),
			'priority' => 3,
			'panel' => 'carpenterservice_frontpage_sections',
		)
	);


	$wp_customize->add_setting('carpenterservice_blog_tabs', array(
	   'sanitize_callback' => 'wp_kses_post',
	));

	$wp_customize->add_control(new carpenterservice_Tab_Control($wp_customize, 'carpenterservice_blog_tabs', array(
	   'section' => 'blog_setting',
	   'priority' => 2,
	   'buttons' => array(
	      array(
         	'name' => esc_html__('General', 'carpenter-service'),
            'icon' => 'dashicons dashicons-welcome-write-blog',
            'fields' => array(
				'blog_disable_section',
            	'blog_subheading',
            	'blog_heading'
            ),
            'active' => true,
         ), 
	      array(
            'name' => esc_html__('Style', 'carpenter-service'),
        	'icon' => 'dashicons dashicons-art',
            'fields' => array(
                'blog_subheadingcolor',
                'blog_headingcolor',
                'blog_titlecolor',
                'blog_descriptioncolor',
                'blog_authorandcategorycolor',
                'blog_datetextcolor',
                'blog_datebg1color'

            ),
     	),
		 array(
	        'name' => esc_html__('Layout', 'carpenter-service'),
	        'icon' => 'dashicons dashicons-layout',
	        'fields' => array(
	            'carpenter_service_blog_section_width',
	            'carpenterservice_blog_padding',
	            'carpenter_service_blog_top_padding',
	            'carpenter_service_blog_bottom_padding',
				'carpenter_service_blog_image_height'
	        ),
     	)
	    
    	),
	))); 


	// General Tab

	// hide show blog section
	$wp_customize->add_setting(
        'blog_disable_section',
        array(
            'sanitize_callback' => 'wp_kses_post',
        )
    ); 
    $wp_customize->add_control(
        new carpenterservice_Toggle_Switch_Custom_Control(
            $wp_customize,
            'blog_disable_section',
            array(
                'settings'      => 'blog_disable_section',
                'section'       => 'blog_setting',
                'label'         => __( 'Disable Section', 'carpenter-service' ),
                'on_off_label'  => array(
                    'on' => __( 'Yes', 'carpenter-service' ),
                    'off' => __( 'No', 'carpenter-service' )
                ),
            )
        )
    );

	// blog subheading Color
	$wp_customize->add_setting(
    	'blog_subheading',
    	array(
			'default' => '',
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 1,
		)
	);	

	$wp_customize->add_control( 
		'blog_subheading',
		array(
		    'label'   		=> __('Sub Heading','carpenter-service'),
		    'section'		=> 'blog_setting',
			'type' 			=> 'text',
			'transport'         => $selective_refresh,
		)  
	);	

	// blog subheading Color
	$wp_customize->add_setting(
    	'blog_heading',
    	array(
			'default' => '',
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 1,
		)
	);	

	$wp_customize->add_control( 
		'blog_heading',
		array(
		    'label'   		=> __('Heading','carpenter-service'),
		    'section'		=> 'blog_setting',
			'type' 			=> 'text',
			'transport'         => $selective_refresh,
		)  
	);	


	// Style setting

	// blog subheading Color
	$blogsubheadingcolor = esc_html__('#707070', 'carpenter-service' );
	$wp_customize->add_setting(
    	'blog_subheadingcolor',
    	array(
			'default' => $blogsubheadingcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'blog_subheadingcolor',
		array(
		    'label'   		=> __('SubHeading Color','carpenter-service'),
		    'section'		=> 'blog_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// blog heading Color
	$blogheadingcolor = esc_html__('#000', 'carpenter-service' );
	$wp_customize->add_setting(
    	'blog_headingcolor',
    	array(
			'default' => $blogheadingcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'blog_headingcolor',
		array(
		    'label'   		=> __('Heading Color','carpenter-service'),
		    'section'		=> 'blog_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);


	// blog title Color
	$blogtitlecolor = esc_html__('#000', 'carpenter-service' );
	$wp_customize->add_setting(
    	'blog_titlecolor',
    	array(
			'default' => $blogtitlecolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'blog_titlecolor',
		array(
		    'label'   		=> __('Title Color','carpenter-service'),
		    'section'		=> 'blog_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// blog description Color
	$blogdescriptioncolor = esc_html__('#000', 'carpenter-service' );
	$wp_customize->add_setting(
    	'blog_descriptioncolor',
    	array(
			'default' => $blogdescriptioncolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'blog_descriptioncolor',
		array(
		    'label'   		=> __('Description Color','carpenter-service'),
		    'section'		=> 'blog_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);


	// blog authorandcategory Color
	$blogauthorandcategorycolor = esc_html__('#000', 'carpenter-service' );
	$wp_customize->add_setting(
    	'blog_authorandcategorycolor',
    	array(
			'default' => $blogauthorandcategorycolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'blog_authorandcategorycolor',
		array(
		    'label'   		=> __('Comments Color','carpenter-service'),
		    'section'		=> 'blog_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// blog datetext Color
	$blogdatetextcolor = esc_html__('#fff', 'carpenter-service' );
	$wp_customize->add_setting(
    	'blog_datetextcolor',
    	array(
			'default' => $blogdatetextcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'blog_datetextcolor',
		array(
		    'label'   		=> __('Date Color','carpenter-service'),
		    'section'		=> 'blog_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// blog datebg1 Color
	$blogdatebg1color = esc_html__('#7C4B2A', 'carpenter-service' );
	$wp_customize->add_setting(
    	'blog_datebg1color',
    	array(
			'default' => $blogdatebg1color,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'blog_datebg1color',
		array(
		    'label'   		=> __('Date BG Color','carpenter-service'),
		    'section'		=> 'blog_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);


	
	// layout setting
	$wp_customize->add_setting('carpenter_service_blog_section_width',array(
        'default' => 'Box Width',
        'sanitize_callback' => 'carpenterservice_sanitize_choices',
    ));
    $wp_customize->add_control('carpenter_service_blog_section_width',array(
        'type' => 'select',
        'label' => __('Section Width','carpenter-service'),
        'choices' => array (
            'Box Width' => __('Box Width','carpenter-service'),
            'Full Width' => __('Full Width','carpenter-service')
        ),
        'section' => 'blog_setting',
    ));


    // blog section padding 
	$wp_customize->add_setting('carpenterservice_blog_padding',array(
      'sanitize_callback'   => 'esc_html'
    ));
    $wp_customize->add_control('carpenterservice_blog_padding',array(
      'label' => __('Section Padding','carpenter-service'),
      'section' => 'blog_setting'
    ));

    $wp_customize->add_setting('carpenter_service_blog_top_padding',array(
        'default' => '5',
        'sanitize_callback' => 'sanitize_text_field'
    ));
    $wp_customize->add_control('carpenter_service_blog_top_padding',array(
	    'type' => 'number',
	    'label' => __('Top','carpenter-service'),
	    'section' => 'blog_setting',
    ));

 	$wp_customize->add_setting('carpenter_service_blog_bottom_padding',array(
        'default' => '2',
        'sanitize_callback' => 'sanitize_text_field'
    ));
    $wp_customize->add_control('carpenter_service_blog_bottom_padding',array(
	    'type' => 'number',
	    'label' => __('Bottom','carpenter-service'),
	    'section' => 'blog_setting',
    ));


	// blog img height
    $wp_customize->add_setting('carpenter_service_blog_image_height',array(
        'default' => 250,
        'sanitize_callback' => 'carpenterservice_sanitize_float'
    ));
    $wp_customize->add_control(new carpenterservice_Custom_Control( $wp_customize, 'carpenter_service_blog_image_height',array(
	    'label' => __('Image Height','carpenter-service'),
	    'section' => 'blog_setting',
	    'input_attrs' => array(
	            'min' => 0,
	            'max' => 500,
	            'step' => 1,
	        ),
    )));



	$wp_customize->register_control_type('carpenterservice_Tab_Control');

}

add_action( 'customize_register', 'carpenterservice_blog_setting' );

// service selective refresh
function carpenterservice_blog_section_partials( $wp_customize ){	
	// blog_title
	$wp_customize->selective_refresh->add_partial( 'blog_title', array(
		'selector'            => '.home-blog .title h6',
		'settings'            => 'blog_title',
		'render_callback'  => 'carpenterservice_blog_title_render_callback',
	
	) );
	
	// blog_subtitle
	$wp_customize->selective_refresh->add_partial( 'blog_subtitle', array(
		'selector'            => '.home-blog .title h2',
		'settings'            => 'blog_subtitle',
		'render_callback'  => 'carpenterservice_blog_subtitle_render_callback',
	
	) );
	
	// blog_description
	$wp_customize->selective_refresh->add_partial( 'blog_description', array(
		'selector'            => '.home-blog .title p',
		'settings'            => 'blog_description',
		'render_callback'  => 'carpenterservice_blog_description_render_callback',
	
	) );	
	}

add_action( 'customize_register', 'carpenterservice_blog_section_partials' );

// blog_title
function carpenterservice_blog_title_render_callback() {
	return get_theme_mod( 'blog_title' );
}

// blog_subtitle
function carpenterservice_blog_subtitle_render_callback() {
	return get_theme_mod( 'blog_subtitle' );
}

// service description
function carpenterservice_blog_description_render_callback() {
	return get_theme_mod( 'blog_description' );
}


