<?php
/**
 * Motivational Speaker: Customizer-home-page
 *
 * @subpackage Motivational Speaker
 * @since 1.0
 */

//  Home Page Panel
	$wp_customize->add_panel( 'motivational_speaker_custompage_panel', array(
		'title' => esc_html__( 'Custom Page Settings', 'motivational-speaker' ),
		'priority' => 2,
	));
	// Top Header
    $wp_customize->add_section('motivational_speaker_top',array(
        'title' => __('Header Settings', 'motivational-speaker'),
        'panel' => 'motivational_speaker_custompage_panel',
    ) );
    $wp_customize->add_setting( 'motivational_speaker_section_contact_heading', array(
		'default'           => '',
		'transport'         => 'refresh',
		'sanitize_callback' => 'sanitize_text_field',
	) );
	$wp_customize->add_control( new Motivational_Speaker_Customizer_Customcontrol_Section_Heading( $wp_customize, 'motivational_speaker_section_contact_heading', array(
		'label'       => esc_html__( 'Header Settings', 'motivational-speaker' ),		
		'section'     => 'motivational_speaker_top',
		'settings'    => 'motivational_speaker_section_contact_heading',
	) ) );
	$wp_customize->add_setting(
		'motivational_speaker_search_enable',
		array(
			'type'                 => 'option',
			'capability'           => 'edit_theme_options',
			'theme_supports'       => '',
			'default'              => '1',
			'transport'            => 'refresh',
			'sanitize_callback'    => 'motivational_speaker_callback_sanitize_switch',
		)
	);
	$wp_customize->add_control(
		new Motivational_Speaker_Customizer_Customcontrol_Switch(
			$wp_customize,
			'motivational_speaker_search_enable',
			array(
				'settings'        => 'motivational_speaker_search_enable',
				'section'         => 'motivational_speaker_top',
				'label'           => __( 'Check to show search bar', 'motivational-speaker' ),				
				'choices'		  => array(
					'1'      => __( 'On', 'motivational-speaker' ),
					'off'    => __( 'Off', 'motivational-speaker' ),
				),
				'active_callback' => '',
			)
		)
	);
    $wp_customize->add_setting('motivational_speaker_call_text',array(
		'default' => '',
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('motivational_speaker_call_text',array(
		'label' => esc_html__('Add Phone Text','motivational-speaker'),
		'section' => 'motivational_speaker_top',
		'setting' => 'motivational_speaker_call_text',
		'type'    => 'text'
	));
    $wp_customize->add_setting('motivational_speaker_call_number',array(
		'default' => '',
		'sanitize_callback' => 'motivational_speaker_sanitize_phone_number'
	));
	$wp_customize->add_control('motivational_speaker_call_number',array(
		'label' => esc_html__('Add Phone Number','motivational-speaker'),
		'section' => 'motivational_speaker_top',
		'setting' => 'motivational_speaker_call_number',
		'type'    => 'text'
	));
	$wp_customize->add_setting('motivational_speaker_call_icon',array(
		'default'	=> '',
		'sanitize_callback'	=> 'sanitize_text_field'
	));	
	$wp_customize->add_control(new Motivational_Speaker_Fontawesome_Icon_Chooser(
        $wp_customize,'motivational_speaker_call_icon',array(
		'label'	=> __('Add call Icon','motivational-speaker'),
		'transport' => 'refresh',
		'section'	=> 'motivational_speaker_top',
		'setting'	=> 'motivational_speaker_call_icon',
		'type'		=> 'icon'
	)));
    $wp_customize->add_setting('motivational_speaker_email_address_text',array(
		'default' => '',
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('motivational_speaker_email_address_text',array(
		'label' => esc_html__('Add Email Text','motivational-speaker'),
		'section' => 'motivational_speaker_top',
		'setting' => 'motivational_speaker_email_address_text',
		'type'    => 'text'
	));
    $wp_customize->add_setting('motivational_speaker_email_address',array(
		'default' => '',
		'sanitize_callback' => 'sanitize_email'
	));
	$wp_customize->add_control('motivational_speaker_email_address',array(
		'label' => esc_html__('Add Email Address','motivational-speaker'),
		'section' => 'motivational_speaker_top',
		'setting' => 'motivational_speaker_email_address',
		'type'    => 'text'
	));
	$wp_customize->add_setting('motivational_speaker_email_icon',array(
		'default'	=> '',
		'sanitize_callback'	=> 'sanitize_text_field'
	));	
	$wp_customize->add_control(new Motivational_Speaker_Fontawesome_Icon_Chooser(
        $wp_customize,'motivational_speaker_email_icon',array(
		'label'	=> __('Add email Icon','motivational-speaker'),
		'transport' => 'refresh',
		'section'	=> 'motivational_speaker_top',
		'setting'	=> 'motivational_speaker_email_icon',
		'type'		=> 'icon'
	)));

	// Social Media
    $wp_customize->add_section('motivational_speaker_social_media',array(
        'title' => __('Social Media', 'motivational-speaker'),
        'panel' => 'motivational_speaker_custompage_panel',
    ) );
    $wp_customize->add_setting( 'motivational_speaker_section_social_heading', array(
		'default'           => '',
		'transport'         => 'refresh',
		'sanitize_callback' => 'sanitize_text_field',
	) );
	$wp_customize->add_control( new Motivational_Speaker_Customizer_Customcontrol_Section_Heading( $wp_customize, 'motivational_speaker_section_social_heading', array(
		'label'       => esc_html__( 'Social Media Settings', 'motivational-speaker' ),
		'description' => __( 'Add social media links in the below feilds', 'motivational-speaker' ),			
		'section'     => 'motivational_speaker_social_media',
		'settings'    => 'motivational_speaker_section_social_heading',
	) ) );
	$wp_customize->add_setting(
		'motivational_speaker_social_enable',
		array(
			'type'                 => 'option',
			'capability'           => 'edit_theme_options',
			'theme_supports'       => '',
			'default'              => '1',
			'transport'            => 'refresh',
			'sanitize_callback'    => 'motivational_speaker_callback_sanitize_switch',
		)
	);
	$wp_customize->add_control(
		new Motivational_Speaker_Customizer_Customcontrol_Switch(
			$wp_customize,
			'motivational_speaker_social_enable',
			array(
				'settings'        => 'motivational_speaker_social_enable',
				'section'         => 'motivational_speaker_social_media',
				'label'           => __( 'Check to show social fields', 'motivational-speaker' ),				
				'choices'		  => array(
					'1'      => __( 'On', 'motivational-speaker' ),
					'off'    => __( 'Off', 'motivational-speaker' ),
				),
				'active_callback' => '',
			)
		)
	);
   	$wp_customize->add_setting( 'motivational_speaker_twitter_heading', array(
		'default'           => '',
		'transport'         => 'refresh',
		'sanitize_callback' => 'sanitize_text_field',
	) );
	$wp_customize->add_control( new Motivational_Speaker_Customizer_Customcontrol_Section_Heading( $wp_customize, 'motivational_speaker_twitter_heading', array(
			'label'       => esc_html__( 'Twitter Settings', 'motivational-speaker' ),
			'section'     => 'motivational_speaker_social_media',
			'settings'    => 'motivational_speaker_twitter_heading',
	) ) );
	$wp_customize->add_setting('motivational_speaker_twitter_icon',array(
		'default'	=> 'fab fa-x-twitter',
		'sanitize_callback'	=> 'sanitize_text_field'
	));	
	$wp_customize->add_control(new Motivational_Speaker_Fontawesome_Icon_Chooser(
        $wp_customize,'motivational_speaker_twitter_icon',array(
		'label'	=> __('Add Icon','motivational-speaker'),
		'transport' => 'refresh',
		'section'	=> 'motivational_speaker_social_media',
		'setting'	=> 'motivational_speaker_twitter_icon',
		'type'		=> 'icon'
	)));
	$wp_customize->add_setting('motivational_speaker_twitter',array(
		'default' => '',
		'sanitize_callback' => 'esc_url_raw'
	));
	$wp_customize->add_control('motivational_speaker_twitter',array(
		'label' => esc_html__('Add URL','motivational-speaker'),
		'section' => 'motivational_speaker_social_media',
		'setting' => 'motivational_speaker_twitter',
		'type'    => 'url'
	));
	$wp_customize->add_setting(
		'motivational_speaker_header_twt_target',
		array(
			'type'                 => 'option',
			'capability'           => 'edit_theme_options',
			'theme_supports'       => '',
			'default'              => '1',
			'transport'            => 'refresh',
			'sanitize_callback'    => 'motivational_speaker_callback_sanitize_switch',
		)
	);
	$wp_customize->add_control(
		new Motivational_Speaker_Customizer_Customcontrol_Switch(
			$wp_customize,
			'motivational_speaker_header_twt_target',
			array(
				'settings'        => 'motivational_speaker_header_twt_target',
				'section'         => 'motivational_speaker_social_media',
				'label'           => __( 'Open link in a new tab', 'motivational-speaker' ),				
				'choices'		  => array(
					'1'      => __( 'On', 'motivational-speaker' ),
					'off'    => __( 'Off', 'motivational-speaker' ),
				),
				'active_callback' => '',
			)
		)
	);
	$wp_customize->add_setting( 'motivational_speaker_fb_heading', array(
		'default'           => '',
		'transport'         => 'refresh',
		'sanitize_callback' => 'sanitize_text_field',
	) );
	$wp_customize->add_control( new Motivational_Speaker_Customizer_Customcontrol_Section_Heading( $wp_customize, 'motivational_speaker_fb_heading', array(
			'label'       => esc_html__( ' Facebook Settings', 'motivational-speaker' ),
			'section'     => 'motivational_speaker_social_media',
			'settings'    => 'motivational_speaker_fb_heading',
	) ) );
	$wp_customize->add_setting('motivational_speaker_fb_icon',array(
		'default'	=> 'fab fa-facebook-f',
		'sanitize_callback'	=> 'sanitize_text_field'
	));	
	$wp_customize->add_control(new Motivational_Speaker_Fontawesome_Icon_Chooser(
        $wp_customize,'motivational_speaker_fb_icon',array(
		'label'	=> __('Add Icon','motivational-speaker'),
		'transport' => 'refresh',
		'section'	=> 'motivational_speaker_social_media',
		'setting'	=> 'motivational_speaker_fb_icon',
		'type'		=> 'icon'
	)));
	$wp_customize->add_setting('motivational_speaker_facebook',array(
		'default' => '',
		'sanitize_callback' => 'esc_url_raw'
	));
	$wp_customize->add_control('motivational_speaker_facebook',array(
		'label' => esc_html__('Add URL','motivational-speaker'),
		'section' => 'motivational_speaker_social_media',
		'setting' => 'motivational_speaker_facebook',
		'type'    => 'url'
	));
	$wp_customize->add_setting(
		'motivational_speaker_header_fb_target',
		array(
			'type'                 => 'option',
			'capability'           => 'edit_theme_options',
			'theme_supports'       => '',
			'default'              => '1',
			'transport'            => 'refresh',
			'sanitize_callback'    => 'motivational_speaker_callback_sanitize_switch',
		)
	);
	$wp_customize->add_control(
		new Motivational_Speaker_Customizer_Customcontrol_Switch(
			$wp_customize,
			'motivational_speaker_header_fb_target',
			array(
				'settings'        => 'motivational_speaker_header_fb_target',
				'section'         => 'motivational_speaker_social_media',
				'label'           => __( 'Open link in a new tab', 'motivational-speaker' ),				
				'choices'		  => array(
					'1'      => __( 'On', 'motivational-speaker' ),
					'off'    => __( 'Off', 'motivational-speaker' ),
				),
				'active_callback' => '',
			)
		)
	);
	$wp_customize->add_setting( 'motivational_speaker_youtube_heading', array(
		'default'           => '',
		'transport'         => 'refresh',
		'sanitize_callback' => 'sanitize_text_field',
	) );
	$wp_customize->add_control( new Motivational_Speaker_Customizer_Customcontrol_Section_Heading( $wp_customize, 'motivational_speaker_youtube_heading', array(
			'label'       => esc_html__( ' Youtube Settings', 'motivational-speaker' ),
			'section'     => 'motivational_speaker_social_media',
			'settings'    => 'motivational_speaker_youtube_heading',
	) ) );
	$wp_customize->add_setting('motivational_speaker_youtube_icon',array(
		'default'	=> 'fab fa-youtube',
		'sanitize_callback'	=> 'sanitize_text_field'
	));	
	$wp_customize->add_control(new Motivational_Speaker_Fontawesome_Icon_Chooser(
        $wp_customize,'motivational_speaker_youtube_icon',array(
		'label'	=> __('Add Icon','motivational-speaker'),
		'transport' => 'refresh',
		'section'	=> 'motivational_speaker_social_media',
		'setting'	=> 'motivational_speaker_youtube_icon',
		'type'		=> 'icon'
	)));
	$wp_customize->add_setting('motivational_speaker_youtube',array(
		'default' => '',
		'sanitize_callback' => 'esc_url_raw'
	));
	$wp_customize->add_control('motivational_speaker_youtube',array(
		'label' => esc_html__('Add URL','motivational-speaker'),
		'section' => 'motivational_speaker_social_media',
		'setting' => 'motivational_speaker_youtube',
		'type'    => 'url'
	));
	$wp_customize->add_setting(
		'motivational_speaker_header_youtube_target',
		array(
			'type'                 => 'option',
			'capability'           => 'edit_theme_options',
			'theme_supports'       => '',
			'default'              => '1',
			'transport'            => 'refresh',
			'sanitize_callback'    => 'motivational_speaker_callback_sanitize_switch',
		)
	);
	$wp_customize->add_control(
		new Motivational_Speaker_Customizer_Customcontrol_Switch(
			$wp_customize,
			'motivational_speaker_header_youtube_target',
			array(
				'settings'        => 'motivational_speaker_header_youtube_target',
				'section'         => 'motivational_speaker_social_media',
				'label'           => __( 'Open link in a new tab', 'motivational-speaker' ),				
				'choices'		  => array(
					'1'      => __( 'On', 'motivational-speaker' ),
					'off'    => __( 'Off', 'motivational-speaker' ),
				),
				'active_callback' => '',
			)
		)
	);
	$wp_customize->add_setting( 'motivational_speaker_instagram_heading', array(
		'default'           => '',
		'transport'         => 'refresh',
		'sanitize_callback' => 'sanitize_text_field',
	) );
	$wp_customize->add_control( new Motivational_Speaker_Customizer_Customcontrol_Section_Heading( $wp_customize, 'motivational_speaker_instagram_heading', array(
			'label'       => esc_html__( ' Instagram Settings', 'motivational-speaker' ),
			'section'     => 'motivational_speaker_social_media',
			'settings'    => 'motivational_speaker_instagram_heading',
	) ) );
	$wp_customize->add_setting('motivational_speaker_instagram_icon',array(
		'default'	=> 'fab fa-instagram',
		'sanitize_callback'	=> 'sanitize_text_field'
	));	
	$wp_customize->add_control(new Motivational_Speaker_Fontawesome_Icon_Chooser(
        $wp_customize,'motivational_speaker_instagram_icon',array(
		'label'	=> __('Add Icon','motivational-speaker'),
		'transport' => 'refresh',
		'section'	=> 'motivational_speaker_social_media',
		'setting'	=> 'motivational_speaker_instagram_icon',
		'type'		=> 'icon'
	)));
	$wp_customize->add_setting('motivational_speaker_instagram',array(
		'default' => '',
		'sanitize_callback' => 'esc_url_raw'
	));
	$wp_customize->add_control('motivational_speaker_instagram',array(
		'label' => esc_html__('Add URL','motivational-speaker'),
		'section' => 'motivational_speaker_social_media',
		'setting' => 'motivational_speaker_instagram',
		'type'    => 'url'
	));
	$wp_customize->add_setting(
		'motivational_speaker_header_instagram_target',
		array(
			'type'                 => 'option',
			'capability'           => 'edit_theme_options',
			'theme_supports'       => '',
			'default'              => '1',
			'transport'            => 'refresh',
			'sanitize_callback'    => 'motivational_speaker_callback_sanitize_switch',
		)
	);
	$wp_customize->add_control(
		new Motivational_Speaker_Customizer_Customcontrol_Switch(
			$wp_customize,
			'motivational_speaker_header_instagram_target',
			array(
				'settings'        => 'motivational_speaker_header_instagram_target',
				'section'         => 'motivational_speaker_social_media',
				'label'           => __( 'Open link in a new tab', 'motivational-speaker' ),				
				'choices'		  => array(
					'1'      => __( 'On', 'motivational-speaker' ),
					'off'    => __( 'Off', 'motivational-speaker' ),
				),
				'active_callback' => '',
			)
		)
	);

    //Slider
	$wp_customize->add_section( 'motivational_speaker_slider_section' , array(
    	'title'      => __( 'Slider Settings', 'motivational-speaker' ),
    	'panel' => 'motivational_speaker_custompage_panel',
	) );
	$wp_customize->add_setting( 'motivational_speaker_section_slide_heading', array(
			'default'           => '',
			'transport'         => 'refresh',
			'sanitize_callback' => 'sanitize_text_field',
	) );
	$wp_customize->add_control( new Motivational_Speaker_Customizer_Customcontrol_Section_Heading( $wp_customize, 'motivational_speaker_section_slide_heading', array(
		'label'       => esc_html__( 'Slider Settings', 'motivational-speaker' ),
		'description' => __( 'Slider Image Dimension ( 600px x 700px )', 'motivational-speaker' ),		
		'section'     => 'motivational_speaker_slider_section',
		'settings'    => 'motivational_speaker_section_slide_heading',
	) ) );
	$wp_customize->add_setting(
		'motivational_speaker_slider_arrows',
		array(
			'type'                 => 'option',
			'capability'           => 'edit_theme_options',
			'theme_supports'       => '',
			'default'              => '1',
			'transport'            => 'refresh',
			'sanitize_callback'    => 'motivational_speaker_callback_sanitize_switch',
		)
	);
	$wp_customize->add_control(
		new Motivational_Speaker_Customizer_Customcontrol_Switch(
			$wp_customize,
			'motivational_speaker_slider_arrows',
			array(
				'settings'        => 'motivational_speaker_slider_arrows',
				'section'         => 'motivational_speaker_slider_section',
				'label'           => __( 'Check To Show Slider', 'motivational-speaker' ),				
				'choices'		  => array(
					'1'      => __( 'On', 'motivational-speaker' ),
					'off'    => __( 'Off', 'motivational-speaker' ),
				),
				'active_callback' => '',
			)
		)
	);

	$wp_customize->add_setting('motivational_speaker_slider_count',array(
		'default'	=> '',
		'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('motivational_speaker_slider_count',array(
		'label'	=> esc_html__('Slider Count','motivational-speaker'),
		'section'	=> 'motivational_speaker_slider_section',
		'description' => __( 'After increasing/decreasing counter refresh site for changes to be applied.', 'motivational-speaker' ),
		'type'		=> 'number',
	));

	$motivational_speaker_slider_count = get_theme_mod('motivational_speaker_slider_count');
	
	$args = array('numberposts' => -1);
	$post_list = get_posts($args);
	$i = 0;
	$pst_sls[]= __('Select','motivational-speaker');
	foreach ($post_list as $key => $p_post) {
		$pst_sls[$p_post->ID]=$p_post->post_title;
	}
	for ( $i = 1; $i <= $motivational_speaker_slider_count; $i++ ) {
		$wp_customize->add_setting('motivational_speaker_post_setting'.$i,array(
			'sanitize_callback' => 'motivational_speaker_sanitize_select',
		));
		$wp_customize->add_control('motivational_speaker_post_setting'.$i,array(
			'type'    => 'select',
			'choices' => $pst_sls,
			'label' => __('Select post','motivational-speaker'),
			'section' => 'motivational_speaker_slider_section',
		));
	}
	wp_reset_postdata();

	$wp_customize->add_setting('motivational_speaker_slider_heading_color', array(
	    'default' => '#222222',
	    'sanitize_callback' => 'sanitize_hex_color',
	    'transport' => 'refresh',
	));

	$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'motivational_speaker_slider_heading_color', array(
	    'section' => 'motivational_speaker_slider_section',
	    'label' => esc_html__('Slider Title Color', 'motivational-speaker'),
	)));

	$wp_customize->add_setting(
		'motivational_speaker_slider_excerpt_show_hide',
		array(
			'type'                 => 'option',
			'capability'           => 'edit_theme_options',
			'theme_supports'       => '',
			'default'              => '1',
			'transport'            => 'refresh',
			'sanitize_callback'    => 'motivational_speaker_callback_sanitize_switch',
		)
	);
	$wp_customize->add_control(
		new Motivational_Speaker_Customizer_Customcontrol_Switch(
			$wp_customize,
			'motivational_speaker_slider_excerpt_show_hide',
			array(
				'settings'        => 'motivational_speaker_slider_excerpt_show_hide',
				'section'         => 'motivational_speaker_slider_section',
				'label'           => __( 'Show Hide excerpt', 'motivational-speaker' ),				
				'choices'		  => array(
					'1'      => __( 'On', 'motivational-speaker' ),
					'off'    => __( 'Off', 'motivational-speaker' ),
				),
			)
		)
	);
	$wp_customize->add_setting('motivational_speaker_slider_excerpt_count',array(
		'default'=> 20,
		'transport' => 'refresh',
		'sanitize_callback' => 'motivational_speaker_sanitize_integer'
	));
	$wp_customize->add_control(new Motivational_Speaker_Slider_Custom_Control( $wp_customize, 'motivational_speaker_slider_excerpt_count',array(
		'label' => esc_html__( 'Excerpt Limit','motivational-speaker' ),
		'section'=> 'motivational_speaker_slider_section',
		'settings'=>'motivational_speaker_slider_excerpt_count',
		'input_attrs' => array(
			'reset'			   => 20,
            'step'             => 1,
			'min'              => 0,
			'max'              => 50,
        ),
	)));
	$wp_customize->add_setting('motivational_speaker_slider_excerpt_color', array(
	    'default' => '#222222',
	    'sanitize_callback' => 'sanitize_hex_color',
	    'transport' => 'refresh',
	));

	$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'motivational_speaker_slider_excerpt_color', array(
	    'section' => 'motivational_speaker_slider_section',
	    'label' => esc_html__('Slider Excerpt Color', 'motivational-speaker'),
	)));
	$wp_customize->add_setting(
		'motivational_speaker_slider_button_show_hide',
		array(
			'type'                 => 'option',
			'capability'           => 'edit_theme_options',
			'theme_supports'       => '',
			'default'              => '1',
			'transport'            => 'refresh',
			'sanitize_callback'    => 'motivational_speaker_callback_sanitize_switch',
		)
	);
	$wp_customize->add_control(
		new Motivational_Speaker_Customizer_Customcontrol_Switch(
			$wp_customize,
			'motivational_speaker_slider_button_show_hide',
			array(
				'settings'        => 'motivational_speaker_slider_button_show_hide',
				'section'         => 'motivational_speaker_slider_section',
				'label'           => __( 'Show Hide Button', 'motivational-speaker' ),				
				'choices'		  => array(
					'1'      => __( 'On', 'motivational-speaker' ),
					'off'    => __( 'Off', 'motivational-speaker' ),
				),
			)
		)
	);
	$wp_customize->add_setting('motivational_speaker_slider_read_more',array(
		'default' => 'READ MORE',
		'sanitize_callback' => 'sanitize_text_field'
	)); 
	$wp_customize->add_control('motivational_speaker_slider_read_more',array(
		'label' => esc_html__('Button Text','motivational-speaker'),
		'section' => 'motivational_speaker_slider_section',
		'setting' => 'motivational_speaker_slider_read_more',
		'type'    => 'text',
	));

	$wp_customize->add_setting('motivational_speaker_slider_content_alignment',array(
        'default' => 'LEFT-ALIGN',
        'sanitize_callback' => 'motivational_speaker_sanitize_choices'
	));
	$wp_customize->add_control('motivational_speaker_slider_content_alignment',array(
		'type' => 'radio',
		'label'     => __('Slider Content Alignment', 'motivational-speaker'),
		'section' => 'motivational_speaker_slider_section',
		'type' => 'select',
		'choices' => array(
			'LEFT-ALIGN' => __('LEFT','motivational-speaker'),
            'CENTER-ALIGN' => __('CENTER','motivational-speaker'),
            'RIGHT-ALIGN' => __('RIGHT','motivational-speaker'),
		),
	) );
	$wp_customize->add_setting('motivational_speaker_slider_overlay', array(
	    'default' => '#fff5f3',
	    'sanitize_callback' => 'sanitize_hex_color',
	    'transport' => 'refresh',
	));

	$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'motivational_speaker_slider_overlay', array(
	    'section' => 'motivational_speaker_slider_section',
	    'label' => esc_html__('Slider Overlay Color', 'motivational-speaker'),
	)));
	$wp_customize->add_setting('motivational_speaker_slider_opacity',array(
        'default' => '0.5',
        'sanitize_callback' => 'motivational_speaker_sanitize_choices'
	));
	$wp_customize->add_control('motivational_speaker_slider_opacity',array(
		'type' => 'radio',
		'label'     => __('Slider Opacity', 'motivational-speaker'),
		'section' => 'motivational_speaker_slider_section',
		'type' => 'select',
		'choices' => array(
			'0' => __('0','motivational-speaker'),
			'0.1' => __('0.1','motivational-speaker'),
			'0.2' => __('0.2','motivational-speaker'),
			'0.3' => __('0.3','motivational-speaker'),
			'0.4' => __('0.4','motivational-speaker'),
			'0.5' => __('0.5','motivational-speaker'),
			'0.6' => __('0.6','motivational-speaker'),
			'0.7' => __('0.7','motivational-speaker'),
			'0.8' => __('0.8','motivational-speaker'),
			'0.9' => __('0.9','motivational-speaker'),
			'1' => __('1','motivational-speaker')
		),
	) );

	// Latest Program
	$wp_customize->add_section( 'motivational_speaker_middle_section' , array(
		'title'      => __( 'Latest Program Settings', 'motivational-speaker' ),
		'panel' => 'motivational_speaker_custompage_panel',
	) );
	$wp_customize->add_setting( 'motivational_speaker_section_latest_heading', array(
		'default'           => '',
		'transport'         => 'refresh',
		'sanitize_callback' => 'sanitize_text_field',
	) );
	$wp_customize->add_control( new Motivational_Speaker_Customizer_Customcontrol_Section_Heading( $wp_customize, 'motivational_speaker_section_latest_heading', array(
		'label'       => esc_html__( 'Latest Program Settings', 'motivational-speaker' ),		
		'section'     => 'motivational_speaker_middle_section',
		'settings'    => 'motivational_speaker_section_latest_heading',
	) ) );
	$wp_customize->add_setting(
		'motivational_speaker_program_enable',
		array(
			'type'                 => 'option',
			'capability'           => 'edit_theme_options',
			'theme_supports'       => '',
			'default'              => '1',
			'transport'            => 'refresh',
			'sanitize_callback'    => 'motivational_speaker_callback_sanitize_switch',
		)
	);
	$wp_customize->add_control(
		new Motivational_Speaker_Customizer_Customcontrol_Switch(
			$wp_customize,
			'motivational_speaker_program_enable',
			array(
				'settings'        => 'motivational_speaker_program_enable',
				'section'         => 'motivational_speaker_middle_section',
				'label'           => __( 'Check To Show Section', 'motivational-speaker' ),				
				'choices'		  => array(
					'1'      => __( 'On', 'motivational-speaker' ),
					'off'    => __( 'Off', 'motivational-speaker' ),
				),
				'active_callback' => '',
			)
		)
	);
	$wp_customize->add_setting('motivational_speaker_program_section_title',array(
		'default' => '',
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('motivational_speaker_program_section_title',array(
		'label' => esc_html__('Title','motivational-speaker'),
		'section' => 'motivational_speaker_middle_section',
		'setting' => 'motivational_speaker_program_section_title',
		'type'    => 'text',
	));

	$categories = get_categories();
	$cats = array();
	$i = 0;
	$cat_post[]= 'select';
	foreach($categories as $category){
	if($i==0){
	  $default = $category->slug;
	  $i++;
	}
	$cat_post[$category->slug] = $category->name;
	}
	$wp_customize->add_setting('motivational_speaker_latest_program_setting',array(
		'default' => 'select',
		'sanitize_callback' => 'motivational_speaker_sanitize_select',
	));
	$wp_customize->add_control('motivational_speaker_latest_program_setting',array(
		'type'    => 'select',
		'choices' => $cat_post,
		'label' => esc_html__('Select Category to display Latest Program','motivational-speaker'),
		'section' => 'motivational_speaker_middle_section',
	));

	$wp_customize->add_setting('motivational_speaker_latest_program_order_type',array(
        'default' => 'ascending',
        'sanitize_callback' => 'motivational_speaker_sanitize_choices'
	));
	$wp_customize->add_control('motivational_speaker_latest_program_order_type',array(
        'type' => 'select',
        'label' => __('Post Order','motivational-speaker'),
        'section' => 'motivational_speaker_middle_section',
        'choices' => array(
            'ascending' => __('Oldest to Newest','motivational-speaker'),
            'descending' => __('Newest to Oldest','motivational-speaker'),
            'a-to-z' => __('A&rarr;Z','motivational-speaker'),
            'z-to-a' => __('Z&rarr;A','motivational-speaker'),
        ),
	) );

	$wp_customize->add_setting('motivational_speaker_program_count',array(
		'default'	=> '',
		'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('motivational_speaker_program_count',array(
		'label'	=> esc_html__('Post Count','motivational-speaker'),
		'section'	=> 'motivational_speaker_middle_section',
		'type'		=> 'number',
	));

	$wp_customize->add_setting('motivational_speaker_front_date',
		array(
			'type'                 => 'option',
			'capability'           => 'edit_theme_options',
			'theme_supports'       => '',
			'default'              => '1',
			'transport'            => 'refresh',
			'sanitize_callback'    => 'motivational_speaker_callback_sanitize_switch',
		)
	);
	$wp_customize->add_control(new Motivational_Speaker_Customizer_Customcontrol_Switch(
			$wp_customize,
			'motivational_speaker_front_date',
			array(
				'settings'        => 'motivational_speaker_front_date',
				'section'         => 'motivational_speaker_middle_section',
				'label'           => __( 'show Date', 'motivational-speaker' ),				
				'choices'		  => array(
					'1'      => __( 'On', 'motivational-speaker' ),
					'off'    => __( 'Off', 'motivational-speaker' ),
				),
			)
		)
	);

	//Footer
    $wp_customize->add_section( 'motivational_speaker_footer_copyright', array(
    	'title'      => esc_html__( 'Footer Text', 'motivational-speaker' ),
    	'panel' => 'motivational_speaker_custompage_panel',
	) );
	$wp_customize->add_setting( 'motivational_speaker_section_footer_heading', array(
		'default'           => '',
		'transport'         => 'refresh',
		'sanitize_callback' => 'sanitize_text_field',
	) );
	$wp_customize->add_control( new Motivational_Speaker_Customizer_Customcontrol_Section_Heading( $wp_customize, 'motivational_speaker_section_footer_heading', array(
		'label'       => esc_html__( 'Footer Settings', 'motivational-speaker' ),		
		'section'     => 'motivational_speaker_footer_copyright',
		'settings'    => 'motivational_speaker_section_footer_heading',
	) ) );
    $wp_customize->add_setting('motivational_speaker_footer_text',array(
		'default'	=> 'Motivational Speaker WordPress Theme',
		'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('motivational_speaker_footer_text',array(
		'label'	=> esc_html__('Copyright Text','motivational-speaker'),
		'section'	=> 'motivational_speaker_footer_copyright',
		'type'		=> 'textarea'
	));
	$wp_customize->add_setting('motivational_speaker_footer_content_alignment',array(
        'default' => 'CENTER-ALIGN',
        'sanitize_callback' => 'motivational_speaker_sanitize_choices'
	));
	$wp_customize->add_control('motivational_speaker_footer_content_alignment',array(
		'type' => 'radio',
		'label'     => __('Footer Content Alignment', 'motivational-speaker'),
		'section' => 'motivational_speaker_footer_copyright',
		'type' => 'select',
		'choices' => array(
			'LEFT-ALIGN' => __('LEFT','motivational-speaker'),
            'CENTER-ALIGN' => __('CENTER','motivational-speaker'),
            'RIGHT-ALIGN' => __('RIGHT','motivational-speaker'),
		),
	) );

	$wp_customize->add_setting(
		'motivational_speaker_footer_widgets_show_hide',
		array(
			'type'                 => 'option',
			'capability'           => 'edit_theme_options',
			'theme_supports'       => '',
			'default'              => '1',
			'transport'            => 'refresh',
			'sanitize_callback'    => 'motivational_speaker_callback_sanitize_switch',
		)
	);
	$wp_customize->add_control(
		new Motivational_Speaker_Customizer_Customcontrol_Switch(
			$wp_customize,
			'motivational_speaker_footer_widgets_show_hide',
			array(
				'settings'        => 'motivational_speaker_footer_widgets_show_hide',
				'section'         => 'motivational_speaker_footer_copyright',
				'label'           => __( 'Check To show Footer Widgets', 'motivational-speaker' ),
				'choices'		  => array(
					'1'      => __( 'On', 'motivational-speaker' ),
					'off'    => __( 'Off', 'motivational-speaker' ),
				),
				'active_callback' => '',
			)
		)
	);

	$wp_customize->add_setting('motivational_speaker_footer_widget',array(
        'default' => '4',
        'sanitize_callback' => 'motivational_speaker_sanitize_choices'
	));
	$wp_customize->add_control('motivational_speaker_footer_widget',array(
		'type' => 'radio',
		'label'     => __('Footer Per Column', 'motivational-speaker'),
		'section' => 'motivational_speaker_footer_copyright',
		'type' => 'select',
		'choices' => array(
			'1' => __('1','motivational-speaker'),
            '2' => __('2','motivational-speaker'),
            '3' => __('3','motivational-speaker'),
            '4' => __('4','motivational-speaker'),
		)
	) );