<?php
/**
 * Front Page Settings
 *
 * @package Wellness_Coach_Lite
 */

function wellness_coach_lite_customize_register_frontpage( $wp_customize ) {
	
    /** Front Page Settings */
    $wp_customize->add_panel( 
        'frontpage_settings',
         array(
            'priority'    => 40,
            'capability'  => 'edit_theme_options',
            'title'       => __( 'Front Page Settings', 'wellness-coach-lite' ),
            'description' => __( 'Static Home Page settings.', 'wellness-coach-lite' ),
        ) 
    );
    
    $wp_customize->get_section( 'header_image' )->panel                    = 'frontpage_settings';
    $wp_customize->get_section( 'header_image' )->title                    = __( 'Banner Section', 'wellness-coach-lite' );
    $wp_customize->get_section( 'header_image' )->priority                 = 10;
    $wp_customize->get_control( 'header_image' )->active_callback          = 'wellness_coach_lite_banner_ac';
    $wp_customize->get_control( 'header_video' )->active_callback          = 'wellness_coach_lite_banner_ac';
    $wp_customize->get_control( 'external_header_video' )->active_callback = 'wellness_coach_lite_banner_ac';
    $wp_customize->get_section( 'header_image' )->description              = '';                                               
    $wp_customize->get_setting( 'header_image' )->transport                = 'refresh';
    $wp_customize->get_setting( 'header_video' )->transport                = 'refresh';
    $wp_customize->get_setting( 'external_header_video' )->transport       = 'refresh';
    
    /** Banner Options */
    $wp_customize->add_setting(
		'ed_banner_section',
		array(
			'default'			=> 'static_banner',
			'sanitize_callback' => 'wellness_coach_lite_sanitize_select'
		)
	);

	$wp_customize->add_control(
		new Wellness_Coach_Lite_Select_Control(
    		$wp_customize,
    		'ed_banner_section',
    		array(
                'label'	      => __( 'Banner Options', 'wellness-coach-lite' ),
                'description' => __( 'Choose banner as static image/video or as a slider.', 'wellness-coach-lite' ),
    			'section'     => 'header_image',
    			'choices'     => array(
                    'no_banner'        => __( 'Disable Banner Section', 'wellness-coach-lite' ),
                    'static_banner'    => __( 'Static/Video CTA Banner', 'wellness-coach-lite' ),
                    'static_nl_banner' => __( 'Static/Video Newsletter Banner', 'wellness-coach-lite' ),
                    'slider_banner'    => __( 'Banner as Slider', 'wellness-coach-lite' ),
                ),
                'priority' => 5	
     		)            
		)
	);
    
    /** Sub Title */
    $wp_customize->add_setting(
        'banner_subtitle',
        array(
            'default'           => '',
            'sanitize_callback' => 'sanitize_text_field',
            'transport'         => 'postMessage'
        )
    );
    
    $wp_customize->add_control(
        'banner_subtitle',
        array(
            'label'           => __( 'Subtitle', 'wellness-coach-lite' ),
            'section'         => 'header_image',
            'type'            => 'text',
            'active_callback' => 'wellness_coach_lite_banner_ac'
        )
    );

    $wp_customize->selective_refresh->add_partial( 'banner_subtitle', array(
        'selector' => '.site-banner .banner-caption h5.subtitle',
        'render_callback' => 'wellness_coach_lite_get_banner_subtitle',
    ) );
    
    /** Title */
    $wp_customize->add_setting(
        'banner_title',
        array(
            'default'           => '',
            'sanitize_callback' => 'sanitize_text_field',
            'transport'         => 'postMessage'
        )
    );
    
    $wp_customize->add_control(
        'banner_title',
        array(
            'label'           => __( 'Title', 'wellness-coach-lite' ),
            'section'         => 'header_image',
            'type'            => 'text',
            'active_callback' => 'wellness_coach_lite_banner_ac'
        )
    );

    $wp_customize->selective_refresh->add_partial( 'banner_title', array(
        'selector' => '.site-banner .banner-caption h2.banner-title',
        'render_callback' => 'wellness_coach_lite_get_banner_title',
    ) );
    
    /** Content */
    $wp_customize->add_setting(
        'banner_content',
        array(
            'default'           => '',
            'sanitize_callback' => 'wp_kses_post',
            'transport'         => 'postMessage'
        )
    );
    
    $wp_customize->add_control(
        'banner_content',
        array(
            'label'           => __( 'Description', 'wellness-coach-lite' ),
            'section'         => 'header_image',
            'type'            => 'textarea',
            'active_callback' => 'wellness_coach_lite_banner_ac'
        )
    );

    /** Banner Newsletter */
    $wp_customize->add_setting(
        'banner_newsletter',
        array(
            'default'           => '',
            'sanitize_callback' => 'wp_kses_post',
        )
    );
    
    $wp_customize->add_control(
        'banner_newsletter',
        array(
            'label'           => __( 'Newsletter Shortcode', 'wellness-coach-lite' ),
            'section'         => 'header_image',
            'type'            => 'text',
            'active_callback' => 'wellness_coach_lite_banner_ac'
        )
    );
    
    $wp_customize->selective_refresh->add_partial( 'banner_content', array(
        'selector' => '.site-banner .banner-caption .banner-desc',
        'render_callback' => 'wellness_coach_lite_get_banner_content',
    ) );
    
    $wp_customize->add_setting(
        'button_one',
        array(
            'default'           => '',
            'sanitize_callback' => 'sanitize_text_field',
            'transport'         => 'postMessage'
        )
    );
    
    $wp_customize->add_control(
        'button_one',
        array(
            'label'           => __( 'Button One Label', 'wellness-coach-lite' ),
            'section'         => 'header_image',
            'type'            => 'text',
            'active_callback' => 'wellness_coach_lite_banner_ac'
        )
    );

    $wp_customize->selective_refresh->add_partial( 'button_one', array(
        'selector' => '.site-banner .banner-caption .banner-button-wrap .wc-btn-one',
        'render_callback' => 'wellness_coach_lite_get_banner_button_one',
    ) );
    
    /** Banner Link */
    $wp_customize->add_setting(
        'button_one_url',
        array(
            'default'           => '',
            'sanitize_callback' => 'esc_url_raw',
        )
    );
    
    $wp_customize->add_control(
        'button_one_url',
        array(
            'label'           => __( 'Button One Link', 'wellness-coach-lite' ),
            'section'         => 'header_image',
            'type'            => 'url',
            'active_callback' => 'wellness_coach_lite_banner_ac'
        )
    );
    
    $wp_customize->add_setting(
        'button_one_tab_new',
        array(
            'default'           => false,
            'sanitize_callback' => 'wellness_coach_lite_sanitize_checkbox',
        )
    );
    
    $wp_customize->add_control(
        new Wellness_Coach_Lite_Toggle_Control( 
            $wp_customize,
            'button_one_tab_new',
            array(
                'section'       => 'header_image',
                'label'         => __( 'Button One Open in New tab', 'wellness-coach-lite' ),
                'description'   => __( 'Enable to open button one link in new window.', 'wellness-coach-lite' ),
                'active_callback' => 'wellness_coach_lite_banner_ac'
            )
        )
    );

    $wp_customize->add_setting(
        'button_two',
        array(
            'default'           => '',
            'sanitize_callback' => 'sanitize_text_field',
            'transport'         => 'postMessage'
        )
    );
    
    $wp_customize->add_control(
        'button_two',
        array(
            'label'           => __( 'Button Two Label', 'wellness-coach-lite' ),
            'section'         => 'header_image',
            'type'            => 'text',
            'active_callback' => 'wellness_coach_lite_banner_ac'
        )
    );

    $wp_customize->selective_refresh->add_partial( 'button_two', array(
        'selector' => '.site-banner .banner-caption .banner-button-wrap .wc-btn-two',
        'render_callback' => 'wellness_coach_lite_get_banner_button_two',
    ) );

    $wp_customize->add_setting(
        'button_two_url',
        array(
            'default'           => '',
            'sanitize_callback' => 'esc_url_raw',
        )
    );
    
    $wp_customize->add_control(
        'button_two_url',
        array(
            'label'           => __( 'Button Two Link', 'wellness-coach-lite' ),
            'section'         => 'header_image',
            'type'            => 'url',
            'active_callback' => 'wellness_coach_lite_banner_ac'
        )
    );

    $wp_customize->add_setting(
        'button_two_tab_new',
        array(
            'default'           => false,
            'sanitize_callback' => 'wellness_coach_lite_sanitize_checkbox',
        )
    );
    
    $wp_customize->add_control(
        new Wellness_Coach_Lite_Toggle_Control( 
            $wp_customize,
            'button_two_tab_new',
            array(
                'section'       => 'header_image',
                'label'         => __( 'Button Two Open in New tab', 'wellness-coach-lite' ),
                'description'   => __( 'Enable to open button two link in new window.', 'wellness-coach-lite' ),
                'active_callback' => 'wellness_coach_lite_banner_ac'
            )
        )
    );
    
    $wp_customize->add_setting( 
        'banner_caption_layout', 
        array(
            'default'           => 'left',
            'sanitize_callback' => 'wellness_coach_lite_sanitize_radio'
        ) 
    );
    
    $wp_customize->add_control(
        new Wellness_Coach_Lite_Radio_Buttonset_Control(
            $wp_customize,
            'banner_caption_layout',
            array(
                'section'     => 'header_image',
                'label'       => __( 'Banner Caption Alignment', 'wellness-coach-lite' ),
                'description' => __( 'Choose alignment for banner caption.', 'wellness-coach-lite' ),
                'choices'     => array(
                    'left'      => __( 'Left', 'wellness-coach-lite' ),
                    'right'     => __( 'Right', 'wellness-coach-lite' ),
                ),
                'active_callback' => 'wellness_coach_lite_banner_ac' 
            )
        )
    );
    
    /** Slider Content Style */
    $wp_customize->add_setting(
		'slider_type',
		array(
			'default'			=> 'latest_posts',
			'sanitize_callback' => 'wellness_coach_lite_sanitize_select'
		)
	);

	$wp_customize->add_control(
		new Wellness_Coach_Lite_Select_Control(
    		$wp_customize,
    		'slider_type',
    		array(
                'label'	  => __( 'Slider Content Style', 'wellness-coach-lite' ),
    			'section' => 'header_image',
    			'choices' => array(
                    'latest_posts' => __( 'Latest Posts', 'wellness-coach-lite' ),
                    'cat'          => __( 'Category', 'wellness-coach-lite' ),
                ),
                'active_callback' => 'wellness_coach_lite_banner_ac'	
     		)
		)
	);
    
    /** Slider Category */
    $wp_customize->add_setting(
		'slider_cat',
		array(
			'default'			=> '',
			'sanitize_callback' => 'wellness_coach_lite_sanitize_select'
		)
	);

	$wp_customize->add_control(
		new Wellness_Coach_Lite_Select_Control(
    		$wp_customize,
    		'slider_cat',
    		array(
                'label'	          => __( 'Slider Category', 'wellness-coach-lite' ),
    			'section'         => 'header_image',
    			'choices'         => wellness_coach_lite_get_categories(),
                'active_callback' => 'wellness_coach_lite_banner_ac'	
     		)
		)
	);
    
    /** No. of slides */
    $wp_customize->add_setting(
        'no_of_slides',
        array(
            'default'           => 4,
            'sanitize_callback' => 'wellness_coach_lite_sanitize_number_absint'
        )
    );
    
    $wp_customize->add_control(
		new Wellness_Coach_Lite_Slider_Control( 
			$wp_customize,
			'no_of_slides',
			array(
				'section'     => 'header_image',
                'label'       => __( 'Number of Slides', 'wellness-coach-lite' ),
                'description' => __( 'Choose the number of slides you want to display', 'wellness-coach-lite' ),
                'choices'	  => array(
					'min' 	=> 1,
					'max' 	=> 20,
					'step'	=> 1,
				),
                'active_callback' => 'wellness_coach_lite_banner_ac'                 
			)
		)
	);
    
    /** HR */
    $wp_customize->add_setting(
        'hr',
        array(
            'default'           => '',
            'sanitize_callback' => 'wp_kses_post' 
        )
    );
    
    $wp_customize->add_control(
        new Wellness_Coach_Lite_Note_Control( 
			$wp_customize,
			'hr',
			array(
				'section'	  => 'header_image',
				'description' => '<hr/>',
                'active_callback' => 'wellness_coach_lite_banner_ac'
			)
		)
    ); 
    
    /** Slider Auto */
    $wp_customize->add_setting(
        'slider_auto',
        array(
            'default'           => true,
            'sanitize_callback' => 'wellness_coach_lite_sanitize_checkbox',
        )
    );
    
    $wp_customize->add_control(
		new Wellness_Coach_Lite_Toggle_Control( 
			$wp_customize,
			'slider_auto',
			array(
				'section'     => 'header_image',
				'label'       => __( 'Slider Auto', 'wellness-coach-lite' ),
                'description' => __( 'Enable slider auto transition.', 'wellness-coach-lite' ),
                'active_callback' => 'wellness_coach_lite_banner_ac'
			)
		)
	);
    
    /** Slider Loop */
    $wp_customize->add_setting(
        'slider_loop',
        array(
            'default'           => true,
            'sanitize_callback' => 'wellness_coach_lite_sanitize_checkbox',
        )
    );
    
    $wp_customize->add_control(
		new Wellness_Coach_Lite_Toggle_Control( 
			$wp_customize,
			'slider_loop',
			array(
				'section'     => 'header_image',
				'label'       => __( 'Slider Loop', 'wellness-coach-lite' ),
                'description' => __( 'Enable slider loop.', 'wellness-coach-lite' ),
                'active_callback' => 'wellness_coach_lite_banner_ac'
			)
		)
	);
    
    /** Slider Caption */
    $wp_customize->add_setting(
        'slider_caption',
        array(
            'default'           => true,
            'sanitize_callback' => 'wellness_coach_lite_sanitize_checkbox',
        )
    );
    
    $wp_customize->add_control(
		new Wellness_Coach_Lite_Toggle_Control( 
			$wp_customize,
			'slider_caption',
			array(
				'section'     => 'header_image',
				'label'       => __( 'Slider Caption', 'wellness-coach-lite' ),
                'description' => __( 'Enable slider caption.', 'wellness-coach-lite' ),
                'active_callback' => 'wellness_coach_lite_banner_ac'
			)
		)
	);
    
    /** Full Image */
    $wp_customize->add_setting(
        'slider_full_image',
        array(
            'default'           => false,
            'sanitize_callback' => 'wellness_coach_lite_sanitize_checkbox',
        )
    );
    
    $wp_customize->add_control(
		new Wellness_Coach_Lite_Toggle_Control( 
			$wp_customize,
			'slider_full_image',
			array(
				'section'         => 'header_image',
				'label'           => __( 'Full Image', 'wellness-coach-lite' ),
                'description'     => __( 'Enable to use full size image in slider.', 'wellness-coach-lite' ),
                'active_callback' => 'wellness_coach_lite_banner_ac'
			)
		)
	);
    
    /** Slider Animation */
    $wp_customize->add_setting(
		'slider_animation',
		array(
			'default'			=> '',
			'sanitize_callback' => 'wellness_coach_lite_sanitize_select'
		)
	);

	$wp_customize->add_control(
		new Wellness_Coach_Lite_Select_Control(
    		$wp_customize,
    		'slider_animation',
    		array(
                'label'	      => __( 'Slider Animation', 'wellness-coach-lite' ),
                'section'     => 'header_image',
    			'choices'     => array(
                    'bounceOut'      => __( 'Bounce Out', 'wellness-coach-lite' ),
                    'bounceOutLeft'  => __( 'Bounce Out Left', 'wellness-coach-lite' ),
                    'bounceOutRight' => __( 'Bounce Out Right', 'wellness-coach-lite' ),
                    'bounceOutUp'    => __( 'Bounce Out Up', 'wellness-coach-lite' ),
                    'bounceOutDown'  => __( 'Bounce Out Down', 'wellness-coach-lite' ),
                    'fadeOut'        => __( 'Fade Out', 'wellness-coach-lite' ),
                    'fadeOutLeft'    => __( 'Fade Out Left', 'wellness-coach-lite' ),
                    'fadeOutRight'   => __( 'Fade Out Right', 'wellness-coach-lite' ),
                    'fadeOutUp'      => __( 'Fade Out Up', 'wellness-coach-lite' ),
                    'fadeOutDown'    => __( 'Fade Out Down', 'wellness-coach-lite' ),
                    'flipOutX'       => __( 'Flip OutX', 'wellness-coach-lite' ),
                    'flipOutY'       => __( 'Flip OutY', 'wellness-coach-lite' ),
                    'hinge'          => __( 'Hinge', 'wellness-coach-lite' ),
                    'pulse'          => __( 'Pulse', 'wellness-coach-lite' ),
                    'rollOut'        => __( 'Roll Out', 'wellness-coach-lite' ),
                    'rotateOut'      => __( 'Rotate Out', 'wellness-coach-lite' ),
                    'rubberBand'     => __( 'Rubber Band', 'wellness-coach-lite' ),
                    'shake'          => __( 'Shake', 'wellness-coach-lite' ),
                    ''               => __( 'Slide', 'wellness-coach-lite' ),
                    'slideOutLeft'   => __( 'Slide Out Left', 'wellness-coach-lite' ),
                    'slideOutRight'  => __( 'Slide Out Right', 'wellness-coach-lite' ),
                    'slideOutUp'     => __( 'Slide Out Up', 'wellness-coach-lite' ),
                    'slideOutDown'   => __( 'Slide Out Down', 'wellness-coach-lite' ),
                    'swing'          => __( 'Swing', 'wellness-coach-lite' ),
                    'tada'           => __( 'Tada', 'wellness-coach-lite' ),
                    'zoomOut'        => __( 'Zoom Out', 'wellness-coach-lite' ),
                    'zoomOutLeft'    => __( 'Zoom Out Left', 'wellness-coach-lite' ),
                    'zoomOutRight'   => __( 'Zoom Out Right', 'wellness-coach-lite' ),
                    'zoomOutUp'      => __( 'Zoom Out Up', 'wellness-coach-lite' ),
                    'zoomOutDown'    => __( 'Zoom Out Down', 'wellness-coach-lite' ),                    
                ),
                'active_callback' => 'wellness_coach_lite_banner_ac'                                	
     		)
		)
    );
    
    /** Slider Speed */
    $wp_customize->add_setting(
        'slider_speed',
        array(
            'default'           => 5000,
            'sanitize_callback' => 'wellness_coach_lite_sanitize_number_absint'
        )
    );
    
    $wp_customize->add_control(
        new Wellness_Coach_Lite_Slider_Control( 
            $wp_customize,
            'slider_speed',
            array(
                'section'     => 'header_image',
                'label'       => __( 'Slider Speed', 'wellness-coach-lite' ),
                'description' => __( 'Controls the speed of slider in miliseconds.', 'wellness-coach-lite' ),
                'choices'     => array(
                    'min'  => 1000,
                    'max'  => 20000,
                    'step' => 500,
                ),
                'active_callback' => 'wellness_coach_lite_banner_ac'
            )
        )
    );
    
    /** Read More Text */
    $wp_customize->add_setting(
        'slider_readmore',
        array(
            'default'           => __( 'Learn More', 'wellness-coach-lite' ),
            'sanitize_callback' => 'sanitize_text_field',
            'transport'         => 'postMessage' 
        )
    );
    
    $wp_customize->add_control(
        'slider_readmore',
        array(
            'type'            => 'text',
            'section'         => 'header_image',
            'label'           => __( 'Read More', 'wellness-coach-lite' ),
            'active_callback' => 'wellness_coach_lite_banner_ac'
        )
    );
    
    $wp_customize->selective_refresh->add_partial( 'slider_readmore', array(
        'selector' => '.site-banner .banner-caption .wc-btn',
        'render_callback' => 'wellness_coach_lite_get_slider_readmore',
    ) );

    /** Banner Section Ends */
    
    /** Feature Section */
    $wp_customize->add_section(
        'feature',
        array(
            'title'    => __( 'Feature Section', 'wellness-coach-lite' ),
            'priority' => 30,
            'panel'    => 'frontpage_settings',
        )
    );

    /** Feature Title  */
    $wp_customize->add_setting(
        'feature_title',
        array(
            'default'           => __( 'Health Coach Features', 'wellness-coach-lite' ),
            'sanitize_callback' => 'sanitize_text_field',
            'transport'         => 'postMessage',
        )
    );
    
    $wp_customize->add_control(
        'feature_title',
        array(
            'label'           => __( 'Section Title', 'wellness-coach-lite' ),
            'description'     => __( 'Add title for feature section.', 'wellness-coach-lite' ),
            'section'         => 'feature',
            'priority'    => -1
        )
    );

    $wp_customize->selective_refresh->add_partial( 'feature_title', array(
        'selector' => '.feature-section .section-header .container h2.section-title',
        'render_callback' => 'wellness_coach_lite_get_feature_title',
    ) );    

    /** Feature SubTitle  */
    $wp_customize->add_setting(
        'feature_content',
        array(
            'default'           => '',
            'sanitize_callback' => 'sanitize_text_field',
            'transport'         => 'postMessage',
        )
    );
    
    $wp_customize->add_control(
        'feature_content',
        array(
            'label'           => __( 'Section Content', 'wellness-coach-lite' ),
            'description'     => __( 'Add description for feature section.', 'wellness-coach-lite' ),
            'section'         => 'feature',
            'type'            => 'text',
            'priority'    => -1
        )
    );

    $wp_customize->selective_refresh->add_partial( 'feature_content', array(
        'selector' => '.feature-section .section-header .container .section-desc',
        'render_callback' => 'wellness_coach_lite_get_feature_content',
    ) );

    $wp_customize->add_setting(
        'feature_note_text',
        array(
            'default'           => '',
            'sanitize_callback' => 'wp_kses_post' 
        )
    );
    
    $wp_customize->add_control(
        new Wellness_Coach_Lite_Note_Control( 
            $wp_customize,
            'feature_note_text',
            array(
                'section'     => 'feature',
                'description' => __( '<hr/>Add "Blossom: Image Text" widget for feature section. The recommended image size for this section is 370px by 494px in PNG format.', 'wellness-coach-lite' ),
                'priority'    => -1
            )
        )
    );

    $feature_section = $wp_customize->get_section( 'sidebar-widgets-feature' );
    if ( ! empty( $feature_section ) ) {

        $feature_section->panel     = 'frontpage_settings';
        $feature_section->priority  = 30;
        $wp_customize->get_control( 'feature_note_text' )->section = 'sidebar-widgets-feature';
        $wp_customize->get_control( 'feature_title' )->section  = 'sidebar-widgets-feature';
        $wp_customize->get_control( 'feature_content' )->section  = 'sidebar-widgets-feature';
    }  
    
    /** Feature Section Ends */ 

    /** About Section */
    $wp_customize->add_section(
        'about',
        array(
            'title'    => __( 'About Section', 'wellness-coach-lite' ),
            'priority' => 60,
            'panel'    => 'frontpage_settings',
        )
    );

    /** Background Image  */
    $wp_customize->add_setting( 'about_bg_image',
        array(
            'default'           => '',
            'sanitize_callback' => 'wellness_coach_lite_sanitize_image',
        )
    );
    
    $wp_customize->add_control( 
        new WP_Customize_Image_Control( $wp_customize, 'about_bg_image',
            array(
                'label'         => esc_html__( 'Background Image', 'wellness-coach-lite' ),
                'description'   => esc_html__( 'Choose background image for about section.', 'wellness-coach-lite' ),
                'section'       => 'about',
                'type'          => 'image',
                'priority'      => -1,
            )
        )
    );

    $about_section = $wp_customize->get_section( 'sidebar-widgets-about' );
    if ( ! empty( $about_section ) ) {

        $about_section->panel     = 'frontpage_settings';
        $about_section->priority  = 40;
        $wp_customize->get_control( 'about_bg_image' )->section = 'sidebar-widgets-about';
    } 
    /** About Section Ends */
    
    /** Service Section */
    $wp_customize->add_section(
        'service',
        array(
            'title'    => __( 'Benefits Section', 'wellness-coach-lite' ),
            'priority' => 50,
            'panel'    => 'frontpage_settings',
        )
    );

    /** Service Title  */
    $wp_customize->add_setting(
        'service_title',
        array(
            'default'           => __( 'Health Coach\'s Benefits', 'wellness-coach-lite' ),
            'sanitize_callback' => 'sanitize_text_field',
            'transport'         => 'postMessage',
        )
    );
    
    $wp_customize->add_control(
        'service_title',
        array(
            'label'           => __( 'Section Title', 'wellness-coach-lite' ),
            'section'         => 'service',
            'priority'    => -1
        )
    );

    $wp_customize->selective_refresh->add_partial( 'service_title', array(
        'selector' => '.service-section .section-header h2.section-title',
        'render_callback' => 'wellness_coach_lite_get_service_title',
    ) );    

    /** Service SubTitle  */
    $wp_customize->add_setting(
        'service_content',
        array(
            'default'           => '',
            'sanitize_callback' => 'sanitize_text_field',
            'transport'         => 'postMessage',
        )
    );
    
    $wp_customize->add_control(
        'service_content',
        array(
            'label'           => __( 'Section Description', 'wellness-coach-lite' ),
            'section'         => 'service',
            'type'            => 'text',
            'priority'    => -1
        )
    );

    $wp_customize->selective_refresh->add_partial( 'service_content', array(
        'selector' => '.service-section .section-header .section-desc',
        'render_callback' => 'wellness_coach_lite_get_service_content',
    ) );

    /** Testimonial View ALl Button */
    $wp_customize->add_setting(
        'benefits_view_all_btn_label',
        array(
            'default'           => __( 'View All Benefits', 'wellness-coach-lite' ),
            'sanitize_callback' => 'sanitize_text_field',
            'transport'         => 'postMessage',
        )
    );
    
    $wp_customize->add_control( 'benefits_view_all_btn_label',
        array(
            'section'     => 'service',
            'label'       => __( 'Button Label', 'wellness-coach-lite' ),
            'type'            => 'text',
            'priority'    => -1
        )
    );

    $wp_customize->selective_refresh->add_partial( 'benefits_view_all_btn_label', array(
        'selector' => '.service-section .section-button-wrapper a',
        'render_callback' => 'wellness_coach_lite_get_benefits_btn_label',
    ) );

    /** Benefits View ALL Button Link */
    $wp_customize->add_setting(
        'benefits_view_all_url',
        array(
            'default'           => __( '#', 'wellness-coach-lite' ),
            'sanitize_callback' => 'esc_url_raw',
        )
    );
    
    $wp_customize->add_control( 'benefits_view_all_url',
        array(
            'section'     => 'service',
            'label'       => __( 'Button Link', 'wellness-coach-lite' ),
            'type'            => 'url',
            'priority'    => -1
        )
    );

    $wp_customize->add_setting(
        'service_note_text',
        array(
            'default'           => '',
            'sanitize_callback' => 'wp_kses_post' 
        )
    );
    
    $wp_customize->add_control(
        new Wellness_Coach_Lite_Note_Control( 
            $wp_customize,
            'service_note_text',
            array(
                'section'     => 'service',
                'description' => __( '<hr/>Add "Blossom: Icon text" widget for benefits section.', 'wellness-coach-lite' ),
                'priority'    => -1
            )
        )
    );

    $service_section = $wp_customize->get_section( 'sidebar-widgets-service' );
    if ( ! empty( $service_section ) ) {

        $service_section->panel     = 'frontpage_settings';
        $service_section->priority  = 50;
        $wp_customize->get_control( 'service_note_text' )->section = 'sidebar-widgets-service';
        $wp_customize->get_control( 'service_title' )->section  = 'sidebar-widgets-service';
        $wp_customize->get_control( 'service_content' )->section  = 'sidebar-widgets-service';
        $wp_customize->get_control( 'benefits_view_all_btn_label' )->section  = 'sidebar-widgets-service'; 
        $wp_customize->get_control( 'benefits_view_all_url' )->section  = 'sidebar-widgets-service';
    }  
    
    /** Benefits Section Ends */ 

    /** Testimonial Section */
    $wp_customize->add_section(
        'testimonial',
        array(
            'title'    => __( 'Testimonial Section', 'wellness-coach-lite' ),
            'priority' => 60,
            'panel'    => 'frontpage_settings',
        )
    );

    /** Testimonial Title  */
    $wp_customize->add_setting(
        'testimonial_title',
        array(
            'default'           => __( 'Testimonials', 'wellness-coach-lite' ),
            'sanitize_callback' => 'sanitize_text_field',
            'transport'         => 'postMessage',
        )
    );
    
    $wp_customize->add_control(
        'testimonial_title',
        array(
            'label'       => __( 'Section Title', 'wellness-coach-lite' ),
            'section'     => 'testimonial',
            'priority'    => -1,
            'type'        => 'text',
        )
    );

    $wp_customize->selective_refresh->add_partial( 'testimonial_title', array(
        'selector' => '.testimonial-section .section-header h2.section-title',
        'render_callback' => 'wellness_coach_lite_get_testimonial_title',
    ) );    

    /** Testimonial SubTitle  */
    $wp_customize->add_setting(
        'testimonial_content',
        array(
            'default'           => '',
            'sanitize_callback' => 'sanitize_text_field',
            'transport'         => 'postMessage',
        )
    );
    
    $wp_customize->add_control(
        'testimonial_content',
        array(
            'label'           => __( 'Section Description', 'wellness-coach-lite' ),
            'section'         => 'testimonial',
            'type'            => 'text',
            'priority'    => -1
        )
    );

    $wp_customize->selective_refresh->add_partial( 'testimonial_content', array(
        'selector' => '.testimonial-section .section-header .section-desc',
        'render_callback' => 'wellness_coach_lite_get_testimonial_content',
    ) );

    $wp_customize->add_setting(
        'testimonial_note_text',
        array(
            'default'           => '',
            'sanitize_callback' => 'wp_kses_post' 
        )
    );
    
    $wp_customize->add_control(
        new Wellness_Coach_Lite_Note_Control( 
            $wp_customize,
            'testimonial_note_text',
            array(
                'section'     => 'testimonial',
                'description' => __( '<hr/>Add "Blossom: Testimonial" widget for testimonial section.', 'wellness-coach-lite' ),
                'priority'    => -1
            )
        )
    );

    /** Testimonial View ALl Button */
    $wp_customize->add_setting(
        'testimonial_slider_btn_label',
        array(
            'default'           => __( 'View All Testimonial', 'wellness-coach-lite' ),
            'sanitize_callback' => 'sanitize_text_field',
            'transport'         => 'postMessage',
        )
    );
    
    $wp_customize->add_control( 'testimonial_slider_btn_label',
        array(
            'section'     => 'testimonial',
            'label'       => __( 'Button Label', 'wellness-coach-lite' ),
            'type'            => 'text',
        )
    );

    $wp_customize->selective_refresh->add_partial( 'testimonial_slider_btn_label', array(
        'selector' => '.testimonial-section .section-button-wrapper a',
        'render_callback' => 'wellness_coach_lite_get_testimonial_btn_label',
    ) ); 

    /** Testimonial View ALl Button Link */
    $wp_customize->add_setting(
        'testimonial_slider_btn_link',
        array(
            'default'           => '',
            'sanitize_callback' => 'esc_url_raw',
        )
    );
    
    $wp_customize->add_control( 'testimonial_slider_btn_link',
        array(
            'section'     => 'testimonial',
            'label'       => __( 'Button Link', 'wellness-coach-lite' ),
            'type'            => 'url',
        )
    );

    /** Testimonial Slider Auto */
    $wp_customize->add_setting(
        'testimonial_slider_auto',
        array(
            'default'           => true,
            'sanitize_callback' => 'wellness_coach_lite_sanitize_checkbox',
        )
    );
    
    $wp_customize->add_control(
        new Wellness_Coach_Lite_Toggle_Control( 
            $wp_customize,
            'testimonial_slider_auto',
            array(
                'section'     => 'testimonial',
                'label'       => __( 'Slider Auto', 'wellness-coach-lite' ),
                'description' => __( 'Enable slider auto transition.', 'wellness-coach-lite' ),
            )
        )
    );

    /** Testimonial Slider Loop */
    $wp_customize->add_setting(
        'testimonial_slider_loop',
        array(
            'default'           => true,
            'sanitize_callback' => 'wellness_coach_lite_sanitize_checkbox',
        )
    );
    
    $wp_customize->add_control(
        new Wellness_Coach_Lite_Toggle_Control( 
            $wp_customize,
            'testimonial_slider_loop',
            array(
                'section'     => 'testimonial',
                'label'       => __( 'Slider Loop', 'wellness-coach-lite' ),
                'description' => __( 'Enable slider loop.', 'wellness-coach-lite' ),
            )
        )
    );

    /** Testimonial Slider Speed */
    $wp_customize->add_setting(
        'testimonial_slider_speed',
        array(
            'default'           => 10000,
            'sanitize_callback' => 'wellness_coach_lite_sanitize_number_absint'
        )
    );
    
    $wp_customize->add_control(
        new Wellness_Coach_Lite_Slider_Control( 
            $wp_customize,
            'testimonial_slider_speed',
            array(
                'section'     => 'testimonial',
                'label'       => __( 'Slider Speed', 'wellness-coach-lite' ),
                'description' => __( 'Controls the speed of slider in miliseconds.', 'wellness-coach-lite' ),
                'choices'     => array(
                    'min'  => 1000,
                    'max'  => 20000,
                    'step' => 500,
                ),
            )
        )
    );

    $testimonial_section = $wp_customize->get_section( 'sidebar-widgets-testimonial' );
    if ( ! empty( $testimonial_section ) ) {

        $testimonial_section->panel     = 'frontpage_settings';
        $testimonial_section->priority  = 60;
        $wp_customize->get_control( 'testimonial_note_text' )->section = 'sidebar-widgets-testimonial';
        $wp_customize->get_control( 'testimonial_title' )->section  = 'sidebar-widgets-testimonial';
        $wp_customize->get_control( 'testimonial_content' )->section  = 'sidebar-widgets-testimonial';
        $wp_customize->get_control( 'testimonial_slider_auto' )->section  = 'sidebar-widgets-testimonial';
        $wp_customize->get_control( 'testimonial_slider_loop' )->section  = 'sidebar-widgets-testimonial';
        $wp_customize->get_control( 'testimonial_slider_speed' )->section  = 'sidebar-widgets-testimonial';
        $wp_customize->get_control( 'testimonial_slider_btn_label' )->section  = 'sidebar-widgets-testimonial';
        $wp_customize->get_control( 'testimonial_slider_btn_link' )->section  = 'sidebar-widgets-testimonial';
    }  
    
    /** Testimonial Section Ends */

    /** Wheel of life section */
    $wp_customize->add_section(
        'wheel_of_life',
        array(
            'title'    => __( 'Wheel of Life Section', 'wellness-coach-lite' ),
            'priority' => 70,
            'panel'    => 'frontpage_settings',
        )
    );

    $wp_customize->add_setting(
        'ed_wheeloflife_section',
        array(
            'default'           => false,
            'sanitize_callback' => 'wellness_coach_lite_sanitize_checkbox'
        )
    );
    
    $wp_customize->add_control(
        new Wellness_Coach_Lite_Toggle_Control(
            $wp_customize,
            'ed_wheeloflife_section',
            array(
                'label'       => __( 'Enable Wheel of Life Section', 'wellness-coach-lite' ),
                'section'     => 'wheel_of_life',
            )            
        )
    );

    $wp_customize->add_setting(
        'wol_section_title',
        array(
            'default'           => '',
            'sanitize_callback' => 'sanitize_text_field',
            'transport'         => 'postMessage'
        )
    );
    
    $wp_customize->add_control(
        'wol_section_title',
        array(
            'label'   => __( 'Section Title', 'wellness-coach-lite' ),
            'section' => 'wheel_of_life',
            'type'    => 'text',
            'active_callback' => 'wellness_coach_lite_wheeloflife_ac'
        )
    );
    
    $wp_customize->selective_refresh->add_partial( 'wol_section_title', array(
        'selector'        => '.wheeloflife-section h2.section-title',
        'render_callback' => 'wellness_coach_lite_get_wol_section_title',
    ) );

    $wp_customize->add_setting(
        'wol_section_content',
        array(
            'default'           => '',
            'sanitize_callback' => 'sanitize_text_field',
            'transport'         => 'postMessage'
        )
    );
    
    $wp_customize->add_control(
        'wol_section_content',
        array(
            'label'           => __( 'Section Content', 'wellness-coach-lite' ),
            'section'         => 'wheel_of_life',
            'type'            => 'text',
            'active_callback' => 'wellness_coach_lite_wheeloflife_ac'
        )
    );

    $wp_customize->selective_refresh->add_partial( 'wol_section_content', array(
        'selector'        => '.wheeloflife-section .section-content p',
        'render_callback' => 'wellness_coach_lite_get_wol_section_content',
    ) );

        /** Image */
    $wp_customize->add_setting(
        'wheeloflife_img',
        array(
            'default'           => get_template_directory_uri() . '/images/chart.png',
            'sanitize_callback' => 'wellness_coach_lite_sanitize_image',
        )
    );
    
    $wp_customize->add_control(
        new WP_Customize_Image_Control(
            $wp_customize,
            'wheeloflife_img',
            array(
                'label'             => __( 'Wheel of Life Image', 'wellness-coach-lite' ),
                'section'           => 'wheel_of_life',
                'active_callback'   => 'wellness_coach_lite_wheeloflife_ac'
            )
        )
    );

     /** Tab Section */    
    $wp_customize->add_setting( 
        'wheel_of_life_tab', 
        array(
            'default'           => 'coach',
            'sanitize_callback' => 'wellness_coach_lite_sanitize_radio'
        ) 
    );
    
    $wp_customize->add_control(
        new Wellness_Coach_Lite_Radio_Buttonset_Control(
            $wp_customize,
            'wheel_of_life_tab',
            array(
                'section'	  => 'wheel_of_life',
                'choices'	  => array(
                    'coach' => __( 'Coach Podium', 'wellness-coach-lite' ),
                    'wol'   => __( 'Wheel of Life Plugin', 'wellness-coach-lite' ),
                ),
                'active_callback' => 'wellness_coach_lite_wheeloflife_ac',
            )
        )
    );

    $wp_customize->add_setting(
        'wheeloflife_text_cp',
        array(
            'default'           => '',
            'sanitize_callback' => 'wp_kses_post' 
        )
    );
    
    $wp_customize->add_control(
        new Wellness_Coach_Lite_Note_Control( 
            $wp_customize,
            'wheeloflife_text_cp',
            array(
                'section'         => 'wheel_of_life',
                'description'     => sprintf( __( '%1$sCoach Podium%2$s helps coaches to create interactive "Wheel of Life" assessments to generate leads and enhance client engagement. Learn how to %3$screate Wheel of Life assessment using Coach Podium.%4$s ', 'wellness-coach-lite' ), '<a href="https://coachpodium.com/?utm_source=theme_customizer&utm_medium=theme&utm_campaign=blossom" target="_blank">', '</a>','<a href="https://docs.coachpodium.com/article/creating-wheel-of-life-assessment/?utm_source=theme_customizer&utm_medium=theme&utm_campaign=blossom" target="_blank" >', '</a>' ),
                'active_callback' => 'wellness_coach_lite_wheeloflife_ac'
            )
        )
    );

    $wp_customize->add_setting(
        'wheeloflife_cp_text',
        array(
            'default'           => __( 'Start Assessment','wellness-coach-lite' ),
            'sanitize_callback' => 'sanitize_text_field'
        )
    );
    
    $wp_customize->add_control(
        'wheeloflife_cp_text',
        array(
            'label'     => __( 'Button Label', 'wellness-coach-lite' ),
            'section'   => 'wheel_of_life',
            'type'      => 'text',
            'active_callback' => 'wellness_coach_lite_wheeloflife_ac'
        )
    );

    $wp_customize->add_setting(
        'wheeloflife_url_cp',
        array(
            'default'           => '',
            'sanitize_callback' => 'esc_url_raw', 
        )
    );
    
    $wp_customize->add_control(
        'wheeloflife_url_cp',
        array(
            'label'           => __( 'Button Link', 'wellness-coach-lite' ),
            'section'         => 'wheel_of_life',
            'type'            => 'url',
            'active_callback' => 'wellness_coach_lite_wheeloflife_ac'
        )
    );
    
    if( wellness_coach_lite_is_wheel_of_life_activated() ){
        /** Note */
        $wp_customize->add_setting(
            'wheeloflife_text',
            array(
                'default'           => '',
                'sanitize_callback' => 'wp_kses_post' 
            )
        );
        
        $wp_customize->add_control(
            new Wellness_Coach_Lite_Note_Control( 
                $wp_customize,
                'wheeloflife_text',
                array(
                    'section'         => 'wheel_of_life',
                    'description'     => sprintf( __( '%1$sWheel of Life plugin%2$s helps to create interactive assessment for lead generation. Refer to this %3$sdocumentation%4$s to configure the plugin.', 'wellness-coach-lite' ),'<a href="https://wheeloflife.pro/?utm_source=customizer&utm_medium=BT" target="_blank">','</a>', '<a href="https://wheeloflife.pro/docs/" target="_blank">', '</a>' ),
                    'active_callback' => 'wellness_coach_lite_wheeloflife_ac'
                )
            )
        );

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

		$wp_customize->add_control(
			'wheeloflife_shortcode',
			array(
				'label'         => __('Wheel of Life shortcode', 'wellness-coach-lite'),
				'description'   => __('Enter the Wheel of Life shortcode. Ex. [wheeloflife id=1456]', 'wellness-coach-lite'),
				'section'       => 'wheel_of_life',
				'type'          => 'text',
                'active_callback' => 'wellness_coach_lite_wheeloflife_ac'
			)
		);

        $wp_customize->add_setting(
            'wheeloflife_learn_text',
            array(
                'default'           => '',
                'sanitize_callback' => 'wp_kses_post' 
            )
        );
        
        $wp_customize->add_control(
            new Wellness_Coach_Lite_Note_Control( 
                $wp_customize,
                'wheeloflife_learn_text',
                array(
                    'section'     => 'wheel_of_life',
                    'description' => sprintf( __( 'Refer to this %1$sdocumentation%2$s to learn how to use the shortcode.', 'wellness-coach-lite' ), '<a href="https://kraftplugins.com/wheel-of-life/docs/how-to-display-embed-wheel-of-life-assessments/" target="_blank">', '</a>' ),
                    'active_callback' => 'wellness_coach_lite_wheeloflife_ac'
                )
            )
        );

        $wp_customize->add_setting( 
            'wheeloflife_color', 
            array(
                'default'           => '#f3fcf9',
                'sanitize_callback' => 'sanitize_hex_color',
            ) 
        );
    
        $wp_customize->add_control( 
            new WP_Customize_Color_Control( 
                $wp_customize, 
                'wheeloflife_color', 
                array(
                    'label'       => __( 'Section color', 'wellness-coach-lite' ),
                    'section'     => 'wheel_of_life',
                    'active_callback' => 'wellness_coach_lite_wheeloflife_ac'
                )
            )
        );

    }else{

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

        $wp_customize->add_control(
            new Wellness_Coach_Lite_Note_Control( 
                $wp_customize,
                'wol_activate_note',
                array(
                    'section'         => 'wheel_of_life',
                    'label'           => __( 'Wheel of Life', 'wellness-coach-lite' ),
                    'description'     => sprintf( __( 'Please install and activate the recommended plugin %1$sWheel of Life%2$s. After that option related with this section will be visible.', 'wellness-coach-lite' ), '<a href="' . admin_url( 'themes.php?page=tgmpa-install-plugins' ) . '" target="_blank">', '</a>' ),
                    'active_callback' => 'wellness_coach_lite_wheeloflife_ac'
                )
            )
        ); 
    }
    /** Wheel of life section ends */


    /** Service Two Section */
    $wp_customize->add_section(
        'service-two',
        array(
            'title'    => __( 'Service Two Section', 'wellness-coach-lite' ),
            'priority' => 80,
            'panel'    => 'frontpage_settings',
        )
    );

    /** Service Two Title  */
    $wp_customize->add_setting(
        'service_two_title',
        array(
            'default'           => __( 'Servics', 'wellness-coach-lite' ),
            'sanitize_callback' => 'sanitize_text_field',
            'transport'         => 'postMessage',
        )
    );
    
    $wp_customize->add_control(
        'service_two_title',
        array(
            'label'           => __( 'Service Two Section Title', 'wellness-coach-lite' ),
            'description'     => __( 'Add title for service section.', 'wellness-coach-lite' ),
            'section'         => 'service-two',
            'priority'    => -1
        )
    );

    $wp_customize->selective_refresh->add_partial( 'service_two_title', array(
        'selector' => '.service-offer-section .section-header h2.section-title',
        'render_callback' => 'wellness_coach_lite_get_service_two_title',
    ) );    

    /** Service Two SubTitle  */
    $wp_customize->add_setting(
        'service_two_content',
        array(
            'default'           => '',
            'sanitize_callback' => 'sanitize_text_field',
            'transport'         => 'postMessage',
        )
    );
    
    $wp_customize->add_control(
        'service_two_content',
        array(
            'label'           => __( 'Service Two Section Content', 'wellness-coach-lite' ),
            'description'     => __( 'Add description for service section.', 'wellness-coach-lite' ),
            'section'         => 'service-two',
            'type'            => 'text',
            'priority'    => -1
        )
    );

    $wp_customize->selective_refresh->add_partial( 'service_two_content', array(
        'selector' => '.service-offer-section .section-header .section-desc',
        'render_callback' => 'wellness_coach_lite_get_service_two_content',
    ) );

    $wp_customize->add_setting(
        'service_two_button',
        array(
            'default'           => __( 'View All Services', 'wellness-coach-lite' ),
            'sanitize_callback' => 'sanitize_text_field',
            'transport'         => 'postMessage',
        )
    );
    
    $wp_customize->add_control(
        'service_two_button',
        array(
            'label'           => __( 'Service Two Section Button Label', 'wellness-coach-lite' ),
            'section'         => 'service-two',
            'type'            => 'text',
        )
    );

    $wp_customize->selective_refresh->add_partial( 'service_two_button', array(
        'selector' => '.service-offer-section .section__button-wrapper a.wc-btn',
        'render_callback' => 'wellness_coach_lite_get_service_two_button',
    ) ); 

    $wp_customize->add_setting(
        'service_two_button_url',
        array(
            'default'           => __( '#', 'wellness-coach-lite' ),
            'sanitize_callback' => 'esc_url_raw',
        )
    );
    
    $wp_customize->add_control(
        'service_two_button_url',
        array(
            'label'           => __( 'Service Two Section Button Link', 'wellness-coach-lite' ),
            'section'         => 'service-two',
            'type'            => 'url',
        )
    );

    $wp_customize->add_setting(
        'service_two_note_text',
        array(
            'default'           => '',
            'sanitize_callback' => 'wp_kses_post' 
        )
    );
    
    $wp_customize->add_control(
        new Wellness_Coach_Lite_Note_Control( 
            $wp_customize,
            'service_two_note_text',
            array(
                'section'     => 'service-two',
                'description' => __( '<hr/>Add "Blossom: Icon text" widget for service two section. The recommended image size for this section is 470px by 313px.', 'wellness-coach-lite' ),
                'priority'    => -1
            )
        )
    );

    $service_two_section = $wp_customize->get_section( 'sidebar-widgets-service-two' );
    if ( ! empty( $service_two_section ) ) {

        $service_two_section->panel     = 'frontpage_settings';
        $service_two_section->priority  = 80;
        $wp_customize->get_control( 'service_two_note_text' )->section = 'sidebar-widgets-service-two';
        $wp_customize->get_control( 'service_two_title' )->section  = 'sidebar-widgets-service-two';
        $wp_customize->get_control( 'service_two_content' )->section  = 'sidebar-widgets-service-two';
        $wp_customize->get_control( 'service_two_button' )->section  = 'sidebar-widgets-service-two';
        $wp_customize->get_control( 'service_two_button_url' )->section  = 'sidebar-widgets-service-two';
    }  
    
    /** Service Section Ends */    

    /** Blog Section */
    $wp_customize->add_section(
        'blog_section',
        array(
            'title'    => __( 'Blog Section', 'wellness-coach-lite' ),
            'priority' => 90,
            'panel'    => 'frontpage_settings',
        )
    );

    /** Blog title */
    $wp_customize->add_setting(
        'blog_section_title',
        array(
            'default'           => __( 'Latest Articles', 'wellness-coach-lite' ),
            'sanitize_callback' => 'sanitize_text_field',
            'transport'         => 'postMessage'
        )
    );
    
    $wp_customize->add_control(
        'blog_section_title',
        array(
            'section'           => 'blog_section',
            'label'             => __( 'Section Title', 'wellness-coach-lite' ),
            'type'              => 'text',
            'priority'          => -1,
        )
    );

    /** Selective refresh for blog title. */
    $wp_customize->selective_refresh->add_partial( 'blog_section_title', array(
        'selector'            => '.blog-section .section-header h2.section-title',
        'render_callback'     => 'wellness_coach_lite_blog_title_selective_refresh',
    ) );

    /** Blog description */
    $wp_customize->add_setting(
        'blog_section_subtitle',
        array(
            'default'           => '',
            'sanitize_callback' => 'sanitize_textarea_field',
            'transport'         => 'postMessage'
        )
    );
    
    $wp_customize->add_control(
        'blog_section_subtitle',
        array(
            'section'           => 'blog_section',
            'label'             => __( 'Section Description', 'wellness-coach-lite' ),
            'type'              => 'textarea',
            'priority'          => -1,
        )
    ); 

    /** Selective refresh for blog description. */
    $wp_customize->selective_refresh->add_partial( 'blog_section_subtitle', array(
        'selector'            => '.blog-section .section-desc p',
        'render_callback'     => 'wellness_coach_lite_blog_description_selective_refresh',
    ) );
    
    /** Read More Label */
    $wp_customize->add_setting(
        'blog_readmore',
        array(
            'default'           => __( 'Read More', 'wellness-coach-lite' ),
            'sanitize_callback' => 'sanitize_text_field',
            'transport'         => 'postMessage'
        )
    );
    
    $wp_customize->add_control(
        'blog_readmore',
        array(
            'label'           => __( 'Read More Label', 'wellness-coach-lite' ),
            'section'         => 'blog_section',
            'type'            => 'text',
            'priority'        => -1,
        )
    );
    
    /* Selective refresh for blog readmore btn. */
    $wp_customize->selective_refresh->add_partial( 'blog_readmore', array(
        'selector'        => '.blog-section .button-wrap a',
        'render_callback' => 'wellness_coach_lite_get_blog_read_more_btn',
    ) ); 
    
    /** View All Label */
    $wp_customize->add_setting(
        'blog_view_all',
        array(
            'default'           => __( 'View All Posts', 'wellness-coach-lite' ),
            'sanitize_callback' => 'sanitize_text_field',
            'transport'         => 'postMessage'
        )
    );
    
    $wp_customize->add_control(
        'blog_view_all',
        array(
            'label'           => __( 'View All Label', 'wellness-coach-lite' ),
            'section'         => 'blog_section',
            'type'            => 'text',
            'priority'        => -1,
        )
    );
    
    /* Selective refresh for blog view all btn. */
    $wp_customize->selective_refresh->add_partial( 'blog_view_all', array(
        'selector'        => '.blog-section .section__button-wrapper a',
        'render_callback' => 'wellness_coach_lite_get_blog_view_all_btn',
    ) ); 

    /** No. of Blog Posts */
    $wp_customize->add_setting(
        'no_of_blog_posts',
        array(
            'default'           => 3,
            'sanitize_callback' => 'wellness_coach_lite_sanitize_number_absint'

        )
    );
    
    $wp_customize->add_control(
        new Wellness_Coach_Lite_Slider_Control( 
            $wp_customize,
            'no_of_blog_posts',
            array(
                'section'     => 'blog_section',
                'label'       => __( 'Number of Blog Posts', 'wellness-coach-lite' ),
                'description' => __( 'Choose the number of blog posts you want to display', 'wellness-coach-lite' ),
                'choices'     => array(
                    'min'   => 1,
                    'max'   => 10,
                    'step'  => 1,
                ),
                'priority'    => -1,  
            )
        )
    );

    $wp_customize->add_setting(
        'blog_note_text',
        array(
            'default'           => '',
            'sanitize_callback' => 'wp_kses_post' 
        )
    );
    
    $wp_customize->add_control(
        new Wellness_Coach_Lite_Note_Control( 
            $wp_customize,
            'blog_note_text',
            array(
                'section'     => 'blog_section',
                'description' => __( '<hr/>Add the widgets for this section.', 'wellness-coach-lite' ),
                'priority'    => -1,
            )
        )
    );

    $blog_section = $wp_customize->get_section( 'sidebar-widgets-blog_section' );
    if ( ! empty( $blog_section ) ) {

        $blog_section->panel                                           = 'frontpage_settings';
        $blog_section->priority                                        = 90;
        $wp_customize->get_control( 'blog_note_text' )->section        = 'sidebar-widgets-blog_section';
        $wp_customize->get_control( 'blog_section_title' )->section    = 'sidebar-widgets-blog_section';
        $wp_customize->get_control( 'blog_section_subtitle' )->section = 'sidebar-widgets-blog_section';
        $wp_customize->get_control( 'blog_readmore' )->section         = 'sidebar-widgets-blog_section';
        $wp_customize->get_control( 'blog_view_all' )->section         = 'sidebar-widgets-blog_section';
        $wp_customize->get_control( 'no_of_blog_posts' )->section      = 'sidebar-widgets-blog_section';
    }

    /** Blog Section Ends */  

    /** Contact Section */
    $wp_customize->add_section(
        'contact',
        array(
            'title'    => __( 'Contact Section', 'wellness-coach-lite' ),
            'priority' => 110,
            'panel'    => 'frontpage_settings',
        )
    );

    $wp_customize->add_setting(
        'follow_on_text',
        array(
            'default'           => __( 'Find us on:', 'wellness-coach-lite' ),
            'sanitize_callback' => 'sanitize_text_field', 
        )
    );
    
    $wp_customize->add_control(
        'follow_on_text',
        array(
            'type'            => 'text',
            'section'         => 'contact',
            'label'           => __( 'Contact Section Social Title', 'wellness-coach-lite' ),
            'active_callback' => 'wellness_coach_lite_contact_section_ac'
        )
    );

    $wp_customize->add_setting(
        'contact_note_text',
        array(
            'default'           => '',
            'sanitize_callback' => 'wp_kses_post' 
        )
    );
    
    $wp_customize->add_control(
        new Wellness_Coach_Lite_Note_Control( 
            $wp_customize,
            'contact_note_text',
            array(
                'section'     => 'contact',
                'description' => __( 'Add "Blossom: Contact Widget" & "Text" widgets for contact section', 'wellness-coach-lite' ),
                'priority'    => -1
            )
        )
    );

    /** Contact Section Ends */    

    $contact_section = $wp_customize->get_section( 'sidebar-widgets-contact' );
    if ( ! empty( $contact_section ) ) {

        $contact_section->panel     = 'frontpage_settings';
        $contact_section->priority  = 110;
        $wp_customize->get_control( 'contact_note_text' )->section = 'sidebar-widgets-contact';
        $wp_customize->get_control( 'follow_on_text' )->section = 'sidebar-widgets-contact';
    } 
    
}
add_action( 'customize_register', 'wellness_coach_lite_customize_register_frontpage' );