<?php
/**
 * University Institute Theme Customizer
 *
 * @package University Institute
 */

function university_institute_customize_register( $wp_customize ) {

	load_template( trailingslashit( get_template_directory() ) . 'revolution/inc/fontawesome-change.php' );

	$wp_customize->get_setting( 'blogname' )->transport         = 'postMessage';
	$wp_customize->get_setting( 'blogdescription' )->transport  = 'postMessage';
	$wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage';

	if ( isset( $wp_customize->selective_refresh ) ) {
		$wp_customize->selective_refresh->add_partial(
			'blogname',
			array(
				'selector'        => '.site-title a',
				'render_callback' => 'University_Institute_Customize_partial_blogname',
			)
		);
		$wp_customize->selective_refresh->add_partial(
			'blogdescription',
			array(
				'selector'        => '.site-description',
				'render_callback' => 'University_Institute_Customize_partial_blogdescription',
			)
		);
	}

	/*
    * Theme Options Panel
    */
	$wp_customize->add_panel('university_institute_panel', array(
		'priority' => 25,
		'capability' => 'edit_theme_options',
		'title' => __('University Institute Theme Options', 'university-institute'),
	));

	/*
	* Customizer main header section
	*/

	$wp_customize->add_setting(
		'university_institute_site_title_text',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 1,
			'sanitize_callback' => 'university_institute_sanitize_checkbox',
		)
	);

	$wp_customize->add_control(
		'university_institute_site_title_text',
		array(
			'label'       => __('Enable Title', 'university-institute'),
			'description' => __('Enable or Disable Title from the site', 'university-institute'),
			'section'     => 'title_tagline',
			'type'        => 'checkbox',
		)
	);

	$wp_customize->add_setting(
		'university_institute_site_tagline_text',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 0,
			'sanitize_callback' => 'university_institute_sanitize_checkbox',
		)
	);

	$wp_customize->add_control(
		'university_institute_site_tagline_text',
		array(
			'label'       => __('Enable Tagline', 'university-institute'),
			'description' => __('Enable or Disable Tagline from the site', 'university-institute'),
			'section'     => 'title_tagline',
			'type'        => 'checkbox',
		)
	);

		$wp_customize->add_setting(
		'university_institute_logo_width',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => '150',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);

	$wp_customize->add_control(
		'university_institute_logo_width',
		array(
			'label'       => __('Logo Width in PX', 'university-institute'),
			'section'     => 'title_tagline',
			'type'        => 'number',
			'input_attrs' => array(
	            'min' => 100,
	             'max' => 300,
	             'step' => 1,
	         ),
		)
	);

	/* WooCommerce custom settings */

	$wp_customize->add_section('woocommerce_custom_settings', array(
		'priority'       => 5,
		'capability'     => 'edit_theme_options',
		'theme_supports' => '',
		'title'          => __('WooCommerce Custom Settings', 'university-institute'),
		'panel'       => 'woocommerce',
	));

	$wp_customize->add_setting(
		'university_institute_per_columns',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => '3',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);

	$wp_customize->add_control(
		'university_institute_per_columns',
		array(
			'label'       => __('Product Per Single Row', 'university-institute'),
			'section'     => 'woocommerce_custom_settings',
			'type'        => 'number',
			'input_attrs' => array(
	            'min' => 1,
	             'max' => 4,
	             'step' => 1,
	         ),
		)
	);

	$wp_customize->add_setting(
		'university_institute_product_per_page',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => '6',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);

	$wp_customize->add_control(
		'university_institute_product_per_page',
		array(
			'label'       => __('Product Per One Page', 'university-institute'),
			'section'     => 'woocommerce_custom_settings',
			'type'        => 'number',
			'input_attrs' => array(
	            'min' => 1,
	             'max' => 12,
	             'step' => 1,
	         ),
		)
	);

	/*Related Products Enable Option*/
	$wp_customize->add_setting(
		'university_institute_enable_related_product',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 1,
			'sanitize_callback' => 'university_institute_sanitize_checkbox',
		)
	);

	$wp_customize->add_control(
		'university_institute_enable_related_product',
		array(
			'label'       => __('Enable Related Product', 'university-institute'),
			'description' => __('Checked to show Related Product', 'university-institute'),
			'section'     => 'woocommerce_custom_settings',
			'type'        => 'checkbox',
		)
	);

	$wp_customize->add_setting(
		'custom_related_products_number',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => '3',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);

	$wp_customize->add_control(
		'custom_related_products_number',
		array(
			'label'       => __('Related Product Count', 'university-institute'),
			'section'     => 'woocommerce_custom_settings',
			'type'        => 'number',
			'input_attrs' => array(
	            'min' => 1,
	             'max' => 20,
	             'step' => 1,
	         ),
		)
	);

	$wp_customize->add_setting(
		'custom_related_products_number_per_row',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => '3',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);

	$wp_customize->add_control(
		'custom_related_products_number_per_row',
		array(
			'label'       => __('Related Product Per Row', 'university-institute'),
			'section'     => 'woocommerce_custom_settings',
			'type'        => 'number',
			'input_attrs' => array(
	            'min' => 1,
	             'max' => 4,
	             'step' => 1,
	         ),
		)
	);

	/*Archive Product layout*/
	$wp_customize->add_setting('university_institute_archive_product_layout',array(
        'default' => 'layout-1',
        'sanitize_callback' => 'university_institute_sanitize_choices'
	));
	$wp_customize->add_control('university_institute_archive_product_layout',array(
        'type' => 'select',
        'label' => esc_html__('Archive Product Layout','university-institute'),
        'section' => 'woocommerce_custom_settings',
        'choices' => array(
            'layout-1' => esc_html__('Sidebar On Right','university-institute'),
            'layout-2' => esc_html__('Sidebar On Left','university-institute'),
			'layout-3' => esc_html__('Full Width Layout','university-institute')
        ),
	) );

	/*Single Product layout*/
	$wp_customize->add_setting('university_institute_single_product_layout',array(
        'default' => 'layout-1',
        'sanitize_callback' => 'university_institute_sanitize_choices'
	));
	$wp_customize->add_control('university_institute_single_product_layout',array(
        'type' => 'select',
        'label' => esc_html__('Single Product Layout','university-institute'),
        'section' => 'woocommerce_custom_settings',
        'choices' => array(
            'layout-1' => esc_html__('Sidebar On Right','university-institute'),
            'layout-2' => esc_html__('Sidebar On Left','university-institute'),
			'layout-3' => esc_html__('Full Width Layout','university-institute')
        ),
	) );

	$wp_customize->add_setting('university_institute_woocommerce_product_sale',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
        'default'           => 'Right',
        'sanitize_callback' => 'university_institute_sanitize_choices'
    ));
    $wp_customize->add_control('university_institute_woocommerce_product_sale',array(
        'label'       => esc_html__( 'Woocommerce Product Sale Positions','university-institute' ),
        'type' => 'select',
        'section' => 'woocommerce_custom_settings',
        'choices' => array(
            'Right' => __('Right','university-institute'),
            'Left' => __('Left','university-institute'),
            'Center' => __('Center','university-institute')
        ),
    ) );

	/*Additional Options*/
	$wp_customize->add_section('university_institute_additional_section', array(
		'priority'       => 5,
		'capability'     => 'edit_theme_options',
		'theme_supports' => '',
		'title'          => __('Additional Options', 'university-institute'),
		'panel'       => 'university_institute_panel',
	));

	/*Main Slider Enable Option*/
	$wp_customize->add_setting(
		'university_institute_enable_sticky_header',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => false,
			'sanitize_callback' => 'university_institute_sanitize_checkbox',
		)
	);

	$wp_customize->add_control(
		'university_institute_enable_sticky_header',
		array(
			'label'       => __('Enable Sticky Header', 'university-institute'),
			'description' => __('Checked to enable sticky header', 'university-institute'),
			'section'     => 'university_institute_additional_section',
			'type'        => 'checkbox',
		)
	);

	/*Main Slider Enable Option*/
	$wp_customize->add_setting(
		'university_institute_enable_preloader',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 0,
			'sanitize_callback' => 'university_institute_sanitize_checkbox',
		)
	);

	$wp_customize->add_control(
		'university_institute_enable_preloader',
		array(
			'label'       => __('Enable Preloader', 'university-institute'),
			'description' => __('Checked to show preloader', 'university-institute'),
			'section'     => 'university_institute_additional_section',
			'type'        => 'checkbox',
		)
	);

	/*Breadcrumbs Enable Option*/
	$wp_customize->add_setting(
		'university_institute_enable_breadcrumbs',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 1,
			'sanitize_callback' => 'university_institute_sanitize_checkbox',
		)
	);

	$wp_customize->add_control(
		'university_institute_enable_breadcrumbs',
		array(
			'label'       => __('Enable Breadcrumbs', 'university-institute'),
			'description' => __('Checked to show Breadcrumbs', 'university-institute'),
			'section'     => 'university_institute_additional_section',
			'type'        => 'checkbox',
		)
	);

		/*Pagination Enable Option*/
	$wp_customize->add_setting(
		'university_institute_enable_pagination',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 1,
			'sanitize_callback' => 'university_institute_sanitize_checkbox',
		)
	);

	$wp_customize->add_control(
		'university_institute_enable_pagination',
		array(
			'label'       => __('Enable Pagination', 'university-institute'),
			'description' => __('Checked to show Pagination', 'university-institute'),
			'section'     => 'c_additional_section',
			'type'        => 'checkbox',
		)
	);

		/*Pagination Select Type Option*/
	$wp_customize->add_setting('university_institute_pagination_type',array(
        'default' => 'type-1',
        'sanitize_callback' => 'university_institute_sanitize_choices'
	));
	$wp_customize->add_control('university_institute_pagination_type',array(
        'type' => 'select',
        'label' => esc_html__('Select Pagination Type','university-institute'),
        'section' => 'university_institute_additional_section',
        'choices' => array(
            'type-1' => esc_html__('Type 1','university-institute'),
            'type-2' => esc_html__('Type 2','university-institute'),
        ),
	) );

	/*Post layout*/
	$wp_customize->add_setting('university_institute_archive_layout',array(
        'default' => 'layout-1',
        'sanitize_callback' => 'university_institute_sanitize_choices'
	));
	$wp_customize->add_control('university_institute_archive_layout',array(
        'type' => 'select',
        'label' => esc_html__('Posts Layout','university-institute'),
        'section' => 'university_institute_additional_section',
        'choices' => array(
            'layout-1' => esc_html__('Sidebar On Right','university-institute'),
            'layout-2' => esc_html__('Sidebar On Left','university-institute'),
			'layout-3' => esc_html__('Full Width Layout','university-institute')
        ),
	) );

	/*single post layout*/
	$wp_customize->add_setting('university_institute_post_layout',array(
        'default' => 'layout-1',
        'sanitize_callback' => 'university_institute_sanitize_choices'
	));
	$wp_customize->add_control('university_institute_post_layout',array(
        'type' => 'select',
        'label' => esc_html__('Single Post Layout','university-institute'),
        'section' => 'university_institute_additional_section',
        'choices' => array(
            'layout-1' => esc_html__('Sidebar On Right','university-institute'),
            'layout-2' => esc_html__('Sidebar On Left','university-institute'),
			'layout-3' => esc_html__('Full Width Layout','university-institute')
        ),
	) );

	/*single page layout*/
	$wp_customize->add_setting('university_institute_page_layout',array(
        'default' => 'layout-1',
        'sanitize_callback' => 'university_institute_sanitize_choices'
	));
	$wp_customize->add_control('university_institute_page_layout',array(
        'type' => 'select',
        'label' => esc_html__('Single Page Layout','university-institute'),
        'section' => 'university_institute_additional_section',
        'choices' => array(
            'layout-1' => esc_html__('Sidebar On Right','university-institute'),
            'layout-2' => esc_html__('Sidebar On Left','university-institute'),
			'layout-3' => esc_html__('Full Width Layout','university-institute')
        ),
	) );

	$wp_customize->add_setting( 
		'university_institute_additional_settings_upgraded_features',
		array(
			'sanitize_callback' => 'sanitize_text_field'
		)
	);

	$wp_customize->add_control(
		'university_institute_additional_settings_upgraded_features', 
		array(
			'type'=> 'hidden',
			'description' => "
				<div class='customizer-upgraded-features'>
					<span class='pro-head'>Want more additional options?</span><br/>
					<span class='pro-text'>						
						<a target='_blank' href='". esc_url(UNIVERSITY_INSTITUTE_BUY_NOW) ." '>Check University Institute PRO version.</a>
					</div>
				</div>
			",
			'section' => 'university_institute_additional_section'
		)
	);

	/*Archive Post Options*/
	$wp_customize->add_section('university_institute_blog_post_section', array(
		'priority'       => 5,
		'capability'     => 'edit_theme_options',
		'theme_supports' => '',
		'title'          => __('Blog Page Options', 'university-institute'),
		'panel'       => 'university_institute_panel',
	));

	$wp_customize->add_setting('university_institute_enable_blog_post_title',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 1,
		'sanitize_callback' => 'university_institute_sanitize_checkbox',
	));
	$wp_customize->add_control('university_institute_enable_blog_post_title',array(
		'label'       => __('Enable Blog Post Title', 'university-institute'),
		'description' => __('Checked To Show Blog Post Title', 'university-institute'),
		'section'     => 'university_institute_blog_post_section',
		'type'        => 'checkbox',
	));

	$wp_customize->add_setting('university_institute_enable_blog_post_meta',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 1,
		'sanitize_callback' => 'university_institute_sanitize_checkbox',
	));
	$wp_customize->add_control('university_institute_enable_blog_post_meta',array(
		'label'       => __('Enable Blog Post Meta', 'university-institute'),
		'description' => __('Checked To Show Blog Post Meta Feilds', 'university-institute'),
		'section'     => 'university_institute_blog_post_section',
		'type'        => 'checkbox',
	));

	$wp_customize->add_setting('university_institute_enable_blog_post_tags',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 1,
		'sanitize_callback' => 'university_institute_sanitize_checkbox',
	));
	$wp_customize->add_control('university_institute_enable_blog_post_tags',array(
		'label'       => __('Enable Blog Post Tags', 'university-institute'),
		'description' => __('Checked To Show Blog Post Tags', 'university-institute'),
		'section'     => 'university_institute_blog_post_section',
		'type'        => 'checkbox',
	));

	$wp_customize->add_setting('university_institute_enable_blog_post_image',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 1,
		'sanitize_callback' => 'university_institute_sanitize_checkbox',
	));
	$wp_customize->add_control('university_institute_enable_blog_post_image',array(
		'label'       => __('Enable Blog Post Image', 'university-institute'),
		'description' => __('Checked To Show Blog Post Image', 'university-institute'),
		'section'     => 'university_institute_blog_post_section',
		'type'        => 'checkbox',
	));

	$wp_customize->add_setting('university_institute_enable_blog_post_content',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 1,
		'sanitize_callback' => 'university_institute_sanitize_checkbox',
	));
	$wp_customize->add_control('university_institute_enable_blog_post_content',array(
		'label'       => __('Enable Blog Post Content', 'university-institute'),
		'description' => __('Checked To Show Blog Post Content', 'university-institute'),
		'section'     => 'university_institute_blog_post_section',
		'type'        => 'checkbox',
	));

	$wp_customize->add_setting('university_institute_enable_blog_post_button',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 1,
		'sanitize_callback' => 'university_institute_sanitize_checkbox',
	));
	$wp_customize->add_control('university_institute_enable_blog_post_button',array(
		'label'       => __('Enable Blog Post Read More Button', 'university-institute'),
		'description' => __('Checked To Show Blog Post Read More Button', 'university-institute'),
		'section'     => 'university_institute_blog_post_section',
		'type'        => 'checkbox',
	));

	/*Blog post Content layout*/
	$wp_customize->add_setting('university_institute_blog_Post_content_layout',array(
        'default' => 'Left',
        'sanitize_callback' => 'university_institute_sanitize_choices'
	));
	$wp_customize->add_control('university_institute_blog_Post_content_layout',array(
        'type' => 'select',
        'label' => esc_html__('Blog Post Content Layout','university-institute'),
        'section' => 'university_institute_blog_post_section',
        'choices' => array(
            'Left' => esc_html__('Left','university-institute'),
            'Center' => esc_html__('Center','university-institute'),
            'Right' => esc_html__('Right','university-institute')
        ),
	) );

	/*Excerpt*/
    $wp_customize->add_setting(
		'university_institute_excerpt_limit',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => '25',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);

	$wp_customize->add_control(
		'university_institute_excerpt_limit',
		array(
			'label'       => __('Excerpt Limit', 'university-institute'),
			'section'     => 'university_institute_blog_post_section',
			'type'        => 'number',
			'input_attrs' => array(
	            'min' => 2,
	             'max' => 50,
	             'step' => 2,
	         ),
		)
	);

	/*Archive Button Text*/
	$wp_customize->add_setting(
		'university_institute_read_more_text',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 'Continue Reading....',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);

	$wp_customize->add_control(
		'university_institute_read_more_text',
		array(
			'label'       => __('Edit Button Text ', 'university-institute'),
			'section'     => 'university_institute_blog_post_section',
			'type'        => 'text',
		)
	);

	/*Single Post Options*/
	$wp_customize->add_section('university_institute_single_post_section', array(
		'priority'       => 5,
		'capability'     => 'edit_theme_options',
		'theme_supports' => '',
		'title'          => __('Single Post Options', 'university-institute'),
		'panel'       => 'university_institute_panel',
	));

	$wp_customize->add_setting('university_institute_enable_single_blog_post_title',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 1,
		'sanitize_callback' => 'university_institute_sanitize_checkbox',
	));
	$wp_customize->add_control('university_institute_enable_single_blog_post_title',array(
		'label'       => __('Enable Single Post Title', 'university-institute'),
		'description' => __('Checked To Show Single Blog Post Title', 'university-institute'),
		'section'     => 'university_institute_single_post_section',
		'type'        => 'checkbox',
	));

	$wp_customize->add_setting('university_institute_enable_single_blog_post_meta',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 1,
		'sanitize_callback' => 'university_institute_sanitize_checkbox',
	));
	$wp_customize->add_control('university_institute_enable_single_blog_post_meta',array(
		'label'       => __('Enable Single Post Meta', 'university-institute'),
		'description' => __('Checked To Show Single Blog Post Meta Feilds', 'university-institute'),
		'section'     => 'university_institute_single_post_section',
		'type'        => 'checkbox',
	));

	$wp_customize->add_setting('university_institute_enable_single_blog_post_tags',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 1,
		'sanitize_callback' => 'university_institute_sanitize_checkbox',
	));
	$wp_customize->add_control('university_institute_enable_single_blog_post_tags',array(
		'label'       => __('Enable Single Post Tags', 'university-institute'),
		'description' => __('Checked To Show Single Blog Post Tags', 'university-institute'),
		'section'     => 'university_institute_single_post_section',
		'type'        => 'checkbox',
	));

	$wp_customize->add_setting('university_institute_enable_single_post_image',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 1,
		'sanitize_callback' => 'university_institute_sanitize_checkbox',
	));
	$wp_customize->add_control('university_institute_enable_single_post_image',array(
		'label'       => __('Enable Single Post Image', 'university-institute'),
		'description' => __('Checked To Show Single Post Image', 'university-institute'),
		'section'     => 'university_institute_single_post_section',
		'type'        => 'checkbox',
	));

	$wp_customize->add_setting('university_institute_enable_single_blog_post_content',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 1,
		'sanitize_callback' => 'university_institute_sanitize_checkbox',
	));
	$wp_customize->add_control('university_institute_enable_single_blog_post_content',array(
		'label'       => __('Enable Single Post Content', 'university-institute'),
		'description' => __('Checked To Show Single Blog Post Content', 'university-institute'),
		'section'     => 'university_institute_single_post_section',
		'type'        => 'checkbox',
	));

	/*Related Post Enable Option*/
	$wp_customize->add_setting(
		'university_institute_enable_related_post',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 1,
			'sanitize_callback' => 'university_institute_sanitize_checkbox',
		)
	);

	$wp_customize->add_control(
		'university_institute_enable_related_post',
		array(
			'label'       => __('Enable Related Post', 'university-institute'),
			'description' => __('Checked to show Related Post', 'university-institute'),
			'section'     => 'university_institute_single_post_section',
			'type'        => 'checkbox',
		)
	);

	/*Related post Edit Text*/
	$wp_customize->add_setting(
		'university_institute_related_post_text',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 'Related Post',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);

	$wp_customize->add_control(
		'university_institute_related_post_text',
		array(
			'label'       => __('Edit Related Post Text ', 'university-institute'),
			'section'     => 'university_institute_single_post_section',
			'type'        => 'text',
		)
	);	

	/*Related Post Per Page*/
	$wp_customize->add_setting(
		'university_institute_related_post_count',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => '3',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);

	$wp_customize->add_control(
		'university_institute_related_post_count',
		array(
			'label'       => __('Related Post Count', 'university-institute'),
			'section'     => 'university_institute_single_post_section',
			'type'        => 'number',
			'input_attrs' => array(
	            'min' => 1,
	             'max' => 9,
	             'step' => 1,
	         ),
		)
	);

	/* Comment Section Enable Option*/
	$wp_customize->add_setting(
		'university_institute_enable_comment_section',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 1,
			'sanitize_callback' => 'university_institute_sanitize_checkbox',
		)
	);

	$wp_customize->add_control(
		'university_institute_enable_comment_section',
		array(
			'label'       => __('Enable Comment Section', 'university-institute'),
			'description' => __('Checked to show Comment Section', 'university-institute'),
			'section'     => 'university_institute_single_post_section',
			'type'        => 'checkbox',
		)
	);

	/*
	* Customizer Global COlor
	*/

	/*Global Color Options*/
	$wp_customize->add_section('university_institute_global_color_section', array(
		'priority'       => 1,
		'capability'     => 'edit_theme_options',
		'theme_supports' => '',
		'title'          => __('Global Color Options', 'university-institute'),
		'panel'       => 'university_institute_panel',
	));

	$wp_customize->add_setting( 'university_institute_primary_color',
		array(
		'default'           => '#6A39CD',
		'capability'        => 'edit_theme_options',
		'sanitize_callback' => 'sanitize_hex_color',
		)
	);
	$wp_customize->add_control( 
		new WP_Customize_Color_Control( 
		$wp_customize, 
		'university_institute_primary_color',
		array(
			'label'      => esc_html__( 'Primary Color', 'university-institute' ),
			'section'    => 'university_institute_global_color_section',
			'settings'   => 'university_institute_primary_color',
		) ) 
	);

	/*Typography Options*/
	$wp_customize->add_section( 'university_institute_typography_section', array(
		'panel'       => 'university_institute_panel',
        'title'    => __( 'Typography Options', 'university-institute' ),
        'priority' => 2,
    ) );

    $wp_customize->add_setting( 'university_institute_font_family', array(
		'default'           => 'default',
		'sanitize_callback' => 'university_institute_sanitize_font_family',
	) );
	
	$wp_customize->add_control( 'university_institute_font_family', array(
		'label'    => __( 'Global Font Family', 'university-institute' ),
		'section'  => 'university_institute_typography_section',
		'type'     => 'select',
		'choices'  => array(
			'default'          => __( 'Default (Theme Font)', 'university-institute' ),
			'bad_script'       => 'Bad Script',
			'roboto'           => 'Roboto',
			'playfair_display' => 'Playfair Display',
			'open_sans'        => 'Open Sans',
			'lobster'          => 'Lobster',
			'merriweather'     => 'Merriweather',
			'oswald'           => 'Oswald',
			'raleway'          => 'Raleway',
		),
	) );

	/*
	* Customizer main header section
	*/

	/*Main Header Options*/
	$wp_customize->add_section('university_institute_header_section', array(
		'priority'       => 5,
		'capability'     => 'edit_theme_options',
		'theme_supports' => '',
		'title'          => __('Main Header Options', 'university-institute'),
		'panel'       => 'university_institute_panel',
	));

	// Add Setting for Menu Text Transform
    $wp_customize->add_setting( 'university_institute_menu_text_transform', array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 'uppercase',
        'sanitize_callback' => 'university_institute_sanitize_choices'
    ) );

    // Add Control for Menu Text Transform
    $wp_customize->add_control( 'university_institute_menu_text_transform', array(
        'label'    => __( 'Menu Text Transform', 'university-institute' ),
        'section'  => 'university_institute_header_section',
        'type'     => 'select',
        'choices'  => array(
            'none'       => __( 'None', 'university-institute' ),
            'capitalize' => __( 'Capitalize', 'university-institute' ),
            'uppercase'  => __( 'Uppercase', 'university-institute' ),
            'lowercase'  => __( 'Lowercase', 'university-institute' ),
        ),
    ) );

	$wp_customize->add_setting(
		'university_institute_show_topbar',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 1,
			'sanitize_callback' => 'university_institute_sanitize_checkbox',
		)
	);
	$wp_customize->add_control(
		'university_institute_show_topbar',
		array(
			'label'       => __('Enable Topbar', 'university-institute'),
			'description' => __('Checked to show the Topbar', 'university-institute'),
			'section'     => 'university_institute_header_section',
			'type'        => 'checkbox',
		)
	);

	/*Main Header Phone Text*/
	$wp_customize->add_setting(
		'university_institute_header_info_phone',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => '+00 123 456 7890',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);
	$wp_customize->add_control(
		'university_institute_header_info_phone',
		array(
			'label'       => __('Edit Phone Number ', 'university-institute'),
			'section'     => 'university_institute_header_section',
			'type'        => 'text',
		)
	);

	$wp_customize->add_setting('university_institute_header_phone_icon',array(
		'default'	=> 'fas fa-phone-alt',
		'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control(new University_Institute_Icon_Changer(
        $wp_customize,'university_institute_header_phone_icon',array(
		'label'	=> __('Phone Number Icon','university-institute'),
		'transport' => 'refresh',
		'section'	=> 'university_institute_header_section',
		'type'		=> 'icon'
	)));

	/*Main Header Phone Text*/
	$wp_customize->add_setting(
		'university_institute_header_info_email',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 'education1245@example.com',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);
	$wp_customize->add_control(
		'university_institute_header_info_email',
		array(
			'label'       => __('Edit Email Address ', 'university-institute'),
			'section'     => 'university_institute_header_section',
			'type'        => 'text',
		)
	);

	$wp_customize->add_setting('university_institute_header_mail_icon',array(
		'default'	=> 'fas fa-envelope-open-text',
		'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control(new University_Institute_Icon_Changer(
        $wp_customize,'university_institute_header_mail_icon',array(
		'label'	=> __('Mail Icon','university-institute'),
		'transport' => 'refresh',
		'section'	=> 'university_institute_header_section',
		'type'		=> 'icon'
	)));

	/*Facebook Link*/
	$wp_customize->add_setting(
		'university_institute_facebook_link_option',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => '#',
			'sanitize_callback' => 'esc_url_raw',
		)
	);
	$wp_customize->add_control(
		'university_institute_facebook_link_option',
		array(
			'label'       => __('Edit Facebook Link', 'university-institute'),
			'section'     => 'university_institute_header_section',
			'type'        => 'url',
		)
	);

	/*Twitter Link*/
	$wp_customize->add_setting(
		'university_institute_twitter_link_option',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => '#',
			'sanitize_callback' => 'esc_url_raw',
		)
	);
	$wp_customize->add_control(
		'university_institute_twitter_link_option',
		array(
			'label'       => __('Edit Twitter Link', 'university-institute'),
			'section'     => 'university_institute_header_section',
			'type'        => 'url',
		)
	);

	/*Instagram Link*/
	$wp_customize->add_setting(
		'university_institute_instagram_link_option',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => '#',
			'sanitize_callback' => 'esc_url_raw',
		)
	);
	$wp_customize->add_control(
		'university_institute_instagram_link_option',
		array(
			'label'       => __('Edit Instagram Link', 'university-institute'),
			'section'     => 'university_institute_header_section',
			'type'        => 'url',
		)
	);

	$wp_customize->add_setting(
		'university_institute_linked_link_option',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => '#',
			'sanitize_callback' => 'esc_url_raw',
		)
	);
	$wp_customize->add_control(
		'university_institute_linked_link_option',
		array(
			'label'       => __('Edit Linkedin Link', 'university-institute'),
			'section'     => 'university_institute_header_section',
			'type'        => 'url',
		)
	);

	$wp_customize->add_setting(
		'university_institute_pinterest_link_option',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => '#',
			'sanitize_callback' => 'esc_url_raw',
		)
	);
	$wp_customize->add_control(
		'university_institute_pinterest_link_option',
		array(
			'label'       => __('Edit Pinterest Link', 'university-institute'),
			'section'     => 'university_institute_header_section',
			'type'        => 'url',
		)
	);

	$wp_customize->add_setting(
		'university_institute_youtube_link_option',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => '#',
			'sanitize_callback' => 'esc_url_raw',
		)
	);
	$wp_customize->add_control(
		'university_institute_youtube_link_option',
		array(
			'label'       => __('Edit Youtube Link', 'university-institute'),
			'section'     => 'university_institute_header_section',
			'type'        => 'url',
		)
	);

	$wp_customize->add_setting( 
		'university_institute_header_settings_upgraded_features',
		array(
			'sanitize_callback' => 'sanitize_text_field'
		)
	);

	$wp_customize->add_control(
		'university_institute_header_settings_upgraded_features', 
		array(
			'type'=> 'hidden',
			'description' => "
				<div class='customizer-upgraded-features'>
					<span class='pro-head'>Want more header options?</span><br/>
					<span class='pro-text'>						
						<a target='_blank' href='". esc_url(UNIVERSITY_INSTITUTE_BUY_NOW) ." '>Check University Institute PRO version.</a>
					</div>
				</div>
			",
			'section' => 'university_institute_header_section'
		)
	);

	/*
	* Customizer main slider section
	*/
	/*Main Slider Options*/
	$wp_customize->add_section('university_institute_slider_section', array(
		'priority'       => 5,
		'capability'     => 'edit_theme_options',
		'theme_supports' => '',
		'title'          => __('Main Slider Options', 'university-institute'),
		'panel'       => 'university_institute_panel',
	));

	/*Main Slider Enable Option*/
	$wp_customize->add_setting(
		'university_institute_enable_slider',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 0,
			'sanitize_callback' => 'university_institute_sanitize_checkbox',
		)
	);

	$wp_customize->add_control(
		'university_institute_enable_slider',
		array(
			'label'       => __('Enable Main Slider', 'university-institute'),
			'description' => __('Checked to show the main slider', 'university-institute'),
			'section'     => 'university_institute_slider_section',
			'type'        => 'checkbox',
		)
	);

	for ($university_institute_i=1; $university_institute_i <= 3; $university_institute_i++) { 

		/*Main Slider Image*/
		$wp_customize->add_setting(
			'university_institute_slider_image'.$university_institute_i,
			array(
				'capability'    => 'edit_theme_options',
		        'default'       => '',
		        'transport'     => 'postMessage',
		        'sanitize_callback' => 'esc_url_raw',
	    	)
	    );

		$wp_customize->add_control( 
			new WP_Customize_Image_Control( $wp_customize, 
				'university_institute_slider_image'.$university_institute_i, 
				array(
			        'label' => __('Edit Slider Image ', 'university-institute') .$university_institute_i,
			        'description' => __('Edit the slider image.', 'university-institute'),
			        'section' => 'university_institute_slider_section',
				)
			)
		);

		/*Main Slider Heading*/
		$wp_customize->add_setting(
			'university_institute_slider_heading'.$university_institute_i,
			array(
				'capability'        => 'edit_theme_options',
				'transport'         => 'refresh',
				'default'           => '',
				'sanitize_callback' => 'sanitize_text_field',
			)
		);

		$wp_customize->add_control(
			'university_institute_slider_heading'.$university_institute_i,
			array(
				'label'       => __('Edit Heading Text ', 'university-institute') .$university_institute_i,
				'description' => __('Edit the slider heading text.', 'university-institute'),
				'section'     => 'university_institute_slider_section',
				'type'        => 'text',
			)
		);

		/*Main Slider Content*/
		$wp_customize->add_setting(
			'university_institute_slider_text'.$university_institute_i,
			array(
				'capability'        => 'edit_theme_options',
				'transport'         => 'refresh',
				'default'           => '',
				'sanitize_callback' => 'sanitize_text_field',
			)
		);

		$wp_customize->add_control(
			'university_institute_slider_text'.$university_institute_i,
			array(
				'label'       => __('Edit Content Text ', 'university-institute') .$university_institute_i,
				'description' => __('Edit the slider content text.', 'university-institute'),
				'section'     => 'university_institute_slider_section',
				'type'        => 'text',
			)
		);

		/*Main Slider Button1 Text*/
		$wp_customize->add_setting(
			'university_institute_slider_button1_text'.$university_institute_i,
			array(
				'capability'        => 'edit_theme_options',
				'transport'         => 'refresh',
				'default'           => '',
				'sanitize_callback' => 'sanitize_text_field',
			)
		);
		$wp_customize->add_control(
			'university_institute_slider_button1_text'.$university_institute_i,
			array(
				'label'       => __('Edit Button #1 Text ', 'university-institute') .$university_institute_i,
				'description' => __('Edit the slider button text.', 'university-institute'),
				'section'     => 'university_institute_slider_section',
				'type'        => 'text',
			)
		);

		/*Main Slider Button1 URL*/
		$wp_customize->add_setting(
			'university_institute_slider_button1_link'.$university_institute_i,
			array(
				'capability'        => 'edit_theme_options',
				'transport'         => 'refresh',
				'default'           => '',
				'sanitize_callback' => 'esc_url_raw',
			)
		);

		$wp_customize->add_control(
			'university_institute_slider_button1_link'.$university_institute_i,
			array(
				'label'       => __('Edit Button #1 URL ', 'university-institute') .$university_institute_i,
				'description' => __('Edit the slider button url.', 'university-institute'),
				'section'     => 'university_institute_slider_section',
				'type'        => 'url',
			)
		);

		/*Main Slider Button2 Text*/
		$wp_customize->add_setting(
			'university_institute_slider_button2_text'.$university_institute_i,
			array(
				'capability'        => 'edit_theme_options',
				'transport'         => 'refresh',
				'default'           => '',
				'sanitize_callback' => 'sanitize_text_field',
			)
		);
		$wp_customize->add_control(
			'university_institute_slider_button2_text'.$university_institute_i,
			array(
				'label'       => __('Edit Button #2 Text ', 'university-institute') .$university_institute_i,
				'description' => __('Edit the slider button text.', 'university-institute'),
				'section'     => 'university_institute_slider_section',
				'type'        => 'text',
			)
		);

		/*Main Slider Button1 URL*/
		$wp_customize->add_setting(
			'university_institute_slider_button2_link'.$university_institute_i,
			array(
				'capability'        => 'edit_theme_options',
				'transport'         => 'refresh',
				'default'           => '',
				'sanitize_callback' => 'esc_url_raw',
			)
		);

		$wp_customize->add_control(
			'university_institute_slider_button2_link'.$university_institute_i,
			array(
				'label'       => __('Edit Button #2 URL ', 'university-institute') .$university_institute_i,
				'description' => __('Edit the slider button url.', 'university-institute'),
				'section'     => 'university_institute_slider_section',
				'type'        => 'url',
			)
		);

	}

	$wp_customize->add_setting( 
		'university_institute_slider_settings_upgraded_features',
		array(
			'sanitize_callback' => 'sanitize_text_field'
		)
	);

	$wp_customize->add_control(
		'university_institute_slider_settings_upgraded_features', 
		array(
			'type'=> 'hidden',
			'description' => "
				<div class='customizer-upgraded-features'>
					<span class='pro-head'>Want more slider options?</span><br/>
					<span class='pro-text'>						
						<a target='_blank' href='". esc_url(UNIVERSITY_INSTITUTE_BUY_NOW) ." '>Check University Institute PRO version.</a>
					</div>
				</div>
			",
			'section' => 'university_institute_slider_section'
		)
	);

	/*=========================================
	service Section
	=========================================*/

	$wp_customize->add_section(
		'university_institute_service_section', array(
			'title' => esc_html__( 'Our Services Section', 'university-institute' ),
			'priority' => 6,
			'panel' => 'university_institute_panel',
		)
	);

	// Hide/ Show Setting // 
	$wp_customize->add_setting( 
		'university_institute_service_show_hide' , 
			array(
			'default' => 0,
			'sanitize_callback' => 'university_institute_sanitize_checkbox',
			'capability' => 'edit_theme_options',
			'priority' => 2,
		) 
	);
	$wp_customize->add_control(
	'university_institute_service_show_hide', 
		array(
			'label'	      => esc_html__( 'Hide / Show Section', 'university-institute' ),
			'section'     => 'university_institute_service_section',
			'settings'    => 'university_institute_service_show_hide',
			'type'        => 'checkbox'
		) 
	);

	$wp_customize->add_setting(
    	'university_institute_section_title',
    	array(
			'default' => '',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);	
	$wp_customize->add_control( 
		'university_institute_section_title',
		array(
		    'label'   		=> __('Add Heading','university-institute'),
		    'section'		=> 'university_institute_service_section',
			'type' 			=> 'text',
		)
	);

	/*Main Header Button Text*/
	$wp_customize->add_setting(
		'university_institute_view_more_button_text',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 'VIEW ALL COURSES',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);
	$wp_customize->add_control(
		'university_institute_view_more_button_text',
		array(
			'label'       => __('Edit Button Text ', 'university-institute'),
			'section'     => 'university_institute_service_section',
			'type'        => 'text',
		)
	);

	/*Main Header Button Link*/
	$wp_customize->add_setting(
		'university_institute_view_more_button_link',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => '',
			'sanitize_callback' => 'esc_url_raw',
		)
	);
	$wp_customize->add_control(
		'university_institute_view_more_button_link',
		array(
			'label'       => __('Edit Button Link ', 'university-institute'),
			'section'     => 'university_institute_service_section',
			'type'        => 'url',
		)
	);

	$university_institute_categories = get_categories();
    $university_institute_cats = array();
    $university_institute_i = 0;
    $university_institute_offer_cat[]= 'select';
    foreach($university_institute_categories as $university_institute_category){
        if($university_institute_i==0){
            $university_institute_default = $university_institute_category->slug;
            $university_institute_i++;
        }
        $university_institute_offer_cat[$university_institute_category->slug] = $university_institute_category->name;
    }

    $wp_customize->add_setting(
    	'university_institute_offer_section_category',
    	array(
	        'default'   => 'uncategorized',
	        'sanitize_callback' => 'university_institute_sanitize_choices',
    	)
    );
    $wp_customize->add_control(
    	'university_institute_offer_section_category',
    	array(
	        'type'    => 'select',
	        'choices' => $university_institute_offer_cat,
	        'label' => __('Select Category','university-institute'),
	        'section' => 'university_institute_service_section',
    	)
    );

    // Setting for number of posts to show
    $wp_customize->add_setting('university_institute_posts_to_show', array(
        'default'           => 2, // Default number of posts to show
        'sanitize_callback' => 'absint', // Sanitization callback
    ));

    // Add control for number of posts to show
    $wp_customize->add_control('university_institute_posts_to_show', array(
        'label'       => __('Number of Post to Show', 'university-institute'),
        'section'     => 'university_institute_service_section',
        'priority'    => 10,
        'type'        => 'number',
        'input_attrs' => array(
            'step' => 1,
            'min'  => 0,
            'max'  => 50,
        ),
    ));

    // Get the number of posts to show
    $university_institute_posts_to_show = get_theme_mod('university_institute_posts_to_show', 3);
    
    // Loop to create settings and controls for each post's price and star rating
    for ($university_institute_i = 1; $university_institute_i <= $university_institute_posts_to_show; $university_institute_i++) {

    	$wp_customize->add_setting('university_institute_courses_price' . $university_institute_i, array(
            'default' => '',
            'sanitize_callback' => 'sanitize_text_field'
        ));
        $wp_customize->add_control('university_institute_courses_price' . $university_institute_i, array(
            'label'    => __('Add Course Price ', 'university-institute') . $university_institute_i,
            'section'  => 'university_institute_service_section',
            'type'     => 'text',
            'priority' => 998,
        ));

        $wp_customize->add_setting('university_institute_course_duration' . $university_institute_i, array(
            'default' => '',
            'sanitize_callback' => 'sanitize_text_field'
        ));
        $wp_customize->add_control('university_institute_course_duration' . $university_institute_i, array(
            'label'    => __('Add Course Duration ', 'university-institute') . $university_institute_i,
            'section'  => 'university_institute_service_section',
            'type'     => 'text',
            'priority' => 998,
        ));

        $wp_customize->add_setting('university_institute_total_user' . $university_institute_i, array(
            'default' => '',
            'sanitize_callback' => 'sanitize_text_field'
        ));
        $wp_customize->add_control('university_institute_total_user' . $university_institute_i, array(
            'label'    => __('Add Total Student ', 'university-institute') . $university_institute_i,
            'section'  => 'university_institute_service_section',
            'type'     => 'text',
            'priority' => 998,
        ));

        $wp_customize->add_setting('university_institute_course_timing' . $university_institute_i, array(
            'default' => '',
            'sanitize_callback' => 'sanitize_text_field'
        ));
        $wp_customize->add_control('university_institute_course_timing' . $university_institute_i, array(
            'label'    => __('Add Course Timing ', 'university-institute') . $university_institute_i,
            'section'  => 'university_institute_service_section',
            'type'     => 'text',
            'priority' => 998,
        ));

    }

	$wp_customize->add_setting( 
		'university_institute_service_settings_upgraded_features',
		array(
			'sanitize_callback' => 'sanitize_text_field'
		)
	);

	$wp_customize->add_control(
		'university_institute_service_settings_upgraded_features', 
		array(
			'type'=> 'hidden',
			'description' => "
				<div class='customizer-upgraded-features'>
					<span class='pro-head'>Want more service options?</span><br/>
					<span class='pro-text'>						
						<a target='_blank' href='". esc_url(UNIVERSITY_INSTITUTE_BUY_NOW) ." '>Check University Institute PRO version.</a>
					</div>
				</div>
			",
			'section' => 'university_institute_service_section'
		)
	);

	/*
	* Customizer Footer Section
	*/
	/*Footer Options*/
	$wp_customize->add_section('university_institute_footer_section', array(
		'priority'       => 8,
		'capability'     => 'edit_theme_options',
		'theme_supports' => '',
		'title'          => __('Footer Options', 'university-institute'),
		'panel'       => 'university_institute_panel',
	));
	
	/*Footer Enable Option*/
	$wp_customize->add_setting(
		'university_institute_enable_footer',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 1,
			'sanitize_callback' => 'university_institute_sanitize_checkbox',
		)
	);
	$wp_customize->add_control(
		'university_institute_enable_footer',
		array(
			'label'       => __('Enable Footer', 'university-institute'),
			'description' => __('Checked to show Footer', 'university-institute'),
			'section'     => 'university_institute_footer_section',
			'type'        => 'checkbox',
		)
	);

	/*Footer bg image Option*/
	$wp_customize->add_setting('university_institute_footer_bg_image',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
        'default'           => '',
        'sanitize_callback' => 'esc_url_raw',
    ));
    $wp_customize->add_control( new WP_Customize_Image_Control($wp_customize,'university_institute_footer_bg_image',array(
        'label' => __('Footer Background Image','university-institute'),
        'section' => 'university_institute_footer_section',
    )));

	/** Footer bg Image Attachment */
    $wp_customize->add_setting('university_institute_background_attachment', array(
        'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 'scroll',
        'sanitize_callback' => 'university_institute_sanitize_choices'
    ));

    $wp_customize->add_control('university_institute_background_attachment', array(
        'label'    => __('Footer Background Attachment', 'university-institute'),
        'section'  => 'university_institute_footer_section',
        'settings' => 'university_institute_background_attachment',
        'type'     => 'select',
        'choices'  => array(
            'fixed' => __('fixed','university-institute'),
            'scroll' => __('scroll','university-institute'),
        ),
    ));

	/*Footer Social Menu Option*/
	$wp_customize->add_setting(
		'university_institute_footer_social_menu',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 1,
			'sanitize_callback' => 'university_institute_sanitize_checkbox',
		)
	);

	$wp_customize->add_control(
		'university_institute_footer_social_menu',
		array(
			'label'       => __('Enable Footer Social Menu', 'university-institute'),
			'description' => __('Checked to show the footer social menu. Go to Dashboard >> Appearance >> Menus >> Create New Menu >> Add Custom Link >> Add Social Menu >> Checked Social Menu >> Save Menu.', 'university-institute'),
			'section'     => 'university_institute_footer_section',
			'type'        => 'checkbox',
		)
	);	

	/*Go To Top Option*/
	$wp_customize->add_setting(
		'university_institute_enable_go_to_top_option',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 1,
			'sanitize_callback' => 'university_institute_sanitize_checkbox',
		)
	);

	$wp_customize->add_control(
		'university_institute_enable_go_to_top_option',
		array(
			'label'       => __('Enable Go To Top', 'university-institute'),
			'description' => __('Checked to enable Go To Top option.', 'university-institute'),
			'section'     => 'university_institute_footer_section',
			'type'        => 'checkbox',
		)
	);

	$wp_customize->add_setting('university_institute_go_to_top_position',array(
        'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 'Right',
        'sanitize_callback' => 'university_institute_sanitize_choices'
    ));
    $wp_customize->add_control('university_institute_go_to_top_position',array(
        'type' => 'select',
        'section' => 'university_institute_footer_section',
        'label' => esc_html__('Go To Top Positions','university-institute'),
        'choices' => array(
            'Right' => __('Right','university-institute'),
            'Left' => __('Left','university-institute'),
            'Center' => __('Center','university-institute')
        ),
    ) );

	/*Footer Copyright Text Enable*/
	$wp_customize->add_setting(
		'university_institute_copyright_option',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => '',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);

	$wp_customize->add_control(
		'university_institute_copyright_option',
		array(
			'label'       => __('Edit Copyright Text', 'university-institute'),
			'description' => __('Edit the Footer Copyright Section.', 'university-institute'),
			'section'     => 'university_institute_footer_section',
			'type'        => 'text',
		)
	);

	$wp_customize->add_setting( 
		'university_institute_footer_settings_upgraded_features',
		array(
			'sanitize_callback' => 'sanitize_text_field'
		)
	);

	$wp_customize->add_control(
		'university_institute_footer_settings_upgraded_features', 
		array(
			'type'=> 'hidden',
			'description' => "
				<div class='customizer-upgraded-features'>
					<span class='pro-head'>Want more footer options?</span><br/>
					<span class='pro-text'>						
						<a target='_blank' href='". esc_url(UNIVERSITY_INSTITUTE_BUY_NOW) ." '>Check University Institute PRO version.</a>
					</div>
				</div>
			",
			'section' => 'university_institute_footer_section'
		)
	);

}
add_action( 'customize_register', 'university_institute_customize_register' );

/**
 * Render the site title for the selective refresh partial.
 *
 * @return void
 */
function University_Institute_Customize_partial_blogname() {
	bloginfo( 'name' );
}

/**
 * Render the site tagline for the selective refresh partial.
 *
 * @return void
 */
function University_Institute_Customize_partial_blogdescription() {
	bloginfo( 'description' );
}

/**
 * Binds JS handlers to make Theme Customizer preview reload changes asynchronously.
 */
function University_Institute_Customize_preview_js() {
	wp_enqueue_script( 'university-institute-customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), UNIVERSITY_INSTITUTE_VERSION, true );
}
add_action( 'customize_preview_init', 'University_Institute_Customize_preview_js' );

/**
 * Singleton class for handling the theme's customizer integration.
 *
 * @since  1.0.0
 * @access public
 */
final class University_Institute_Customize {

	/**
	 * Returns the instance.
	 *
	 * @since  1.0.0
	 * @access public
	 * @return object
	 */
	public static function get_instance() {

		static $university_institute_instance = null;

		if ( is_null( $university_institute_instance ) ) {
			$university_institute_instance = new self;
			$university_institute_instance->setup_actions();
		}

		return $university_institute_instance;
	}

	/**
	 * Constructor method.
	 *
	 * @since  1.0.0
	 * @access private
	 * @return void
	 */
	private function __construct() {}

	/**
	 * Sets up initial actions.
	 *
	 * @since  1.0.0
	 * @access private
	 * @return void
	 */
	private function setup_actions() {

		// Register panels, sections, settings, controls, and partials.
		add_action( 'customize_register', array( $this, 'sections' ) );

		// Register scripts and styles for the controls.
		add_action( 'customize_controls_enqueue_scripts', array( $this, 'enqueue_control_scripts' ), 0 );
	}

	/**
	 * Sets up the customizer sections.
	 *
	 * @since  1.0.0
	 * @access public
	 * @param  object  $university_institute_manager
	 * @return void
	*/
	public function sections( $university_institute_manager ) {
		// Load custom sections.
		load_template( trailingslashit( get_template_directory() ) . '/revolution/inc/section-pro.php' );

		// Register custom section types.
		$university_institute_manager->register_section_type( 'University_Institute_Customize_Section_Pro' );

		// Register sections.
		$university_institute_manager->add_section( new University_Institute_Customize_Section_Pro( $university_institute_manager,'university_institute_go_pro', array(
			'priority'   => 1,
			'title'    => esc_html__( 'University Institute Pro', 'university-institute' ),
			'pro_text' => esc_html__( 'Buy Pro', 'university-institute' ),
			'pro_url'    => esc_url( UNIVERSITY_INSTITUTE_BUY_NOW ),
		) )	);

		// Register sections.
		$university_institute_manager->add_section( new University_Institute_Customize_Section_Pro( $university_institute_manager,'university_institute_lite_documentation', array(
			'priority'   => 1,
			'title'    => esc_html__( 'Lite Documentation', 'university-institute' ),
			'pro_text' => esc_html__( 'Instruction', 'university-institute' ),
			'pro_url'    => esc_url( UNIVERSITY_INSTITUTE_LITE_DOC ),
		) )	);

		$university_institute_manager->add_section( new University_Institute_Customize_Section_Pro( $university_institute_manager, 'university_institute_live_demo', array(
		    'priority'   => 1,
		    'title'      => esc_html__( 'Pro Theme Demo', 'university-institute' ),
		    'pro_text'   => esc_html__( 'Live Preview', 'university-institute' ),
		    'pro_url'    => esc_url( UNIVERSITY_INSTITUTE_LIVE_DEMO ),
		) ) );	
	}

	/**
	 * Loads theme customizer CSS.
	 *
	 * @since  1.0.0
	 * @access public
	 * @return void
	 */
	public function enqueue_control_scripts() {

		wp_enqueue_script( 'university-institute-customize-controls', trailingslashit( get_template_directory_uri() ) . '/revolution/assets/js/customize-controls.js', array( 'customize-controls' ) );

		wp_enqueue_style( 'university-institute-customize-controls', trailingslashit( get_template_directory_uri() ) . '/revolution/assets/css/customize-controls.css' );
	}
}

// Doing this customizer thang!
University_Institute_Customize::get_instance();