<?php
/**
 * SEO Specialist Theme Customizer
 *
 * @package SEO Specialist
 */

function Seo_Specialist_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' => 'Seo_Specialist_Customize_partial_blogname',
			)
		);
		$wp_customize->selective_refresh->add_partial(
			'blogdescription',
			array(
				'selector'        => '.site-description',
				'render_callback' => 'Seo_Specialist_Customize_partial_blogdescription',
			)
		);
	}

	/*
    * Theme Options Panel
    */
	$wp_customize->add_panel('seo_specialist_panel', array(
		'priority' => 25,
		'capability' => 'edit_theme_options',
		'title' => __('SEO Specialist Theme Options', 'seo-specialist'),
	));

	/*
	* Customizer main header section
	*/

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

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

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

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

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

	$wp_customize->add_control(
		'seo_specialist_logo_width',
		array(
			'label'       => __('Logo Width in PX', 'seo-specialist'),
			'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', 'seo-specialist'),
		'panel'       => 'woocommerce',
	));

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

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

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

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

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

	$wp_customize->add_control(
		'seo_specialist_enable_related_product',
		array(
			'label'       => __('Enable Related Product', 'seo-specialist'),
			'description' => __('Checked to show Related Product', 'seo-specialist'),
			'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', 'seo-specialist'),
			'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', 'seo-specialist'),
			'section'     => 'woocommerce_custom_settings',
			'type'        => 'number',
			'input_attrs' => array(
				'min' => 1,
				'max' => 4,
				'step' => 1,
			),
		)
	);

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

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

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


	/*Additional Options*/
	$wp_customize->add_section('seo_specialist_additional_section', array(
		'priority'       => 5,
		'capability'     => 'edit_theme_options',
		'theme_supports' => '',
		'title'          => __('Additional Options', 'seo-specialist'),
		'panel'       => 'seo_specialist_panel',
	));

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

	$wp_customize->add_control(
		'seo_specialist_enable_sticky_header',
		array(
			'label'       => __('Enable Sticky Header', 'seo-specialist'),
			'description' => __('Checked to enable sticky header', 'seo-specialist'),
			'section'     => 'seo_specialist_additional_section',
			'type'        => 'checkbox',
		)
	);

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

	$wp_customize->add_control(
		'seo_specialist_enable_preloader',
		array(
			'label'       => __('Enable Preloader', 'seo-specialist'),
			'description' => __('Checked to show preloader', 'seo-specialist'),
			'section'     => 'seo_specialist_additional_section',
			'type'        => 'checkbox',
		)
	);

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

	$wp_customize->add_control(
		'seo_specialist_enable_breadcrumbs',
		array(
			'label'       => __('Enable Breadcrumbs', 'seo-specialist'),
			'description' => __('Checked to show Breadcrumbs', 'seo-specialist'),
			'section'     => 'seo_specialist_additional_section',
			'type'        => 'checkbox',
		)
	);

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

	$wp_customize->add_control(
		'seo_specialist_enable_pagination',
		array(
			'label'       => __('Enable Pagination', 'seo-specialist'),
			'description' => __('Checked to show Pagination', 'seo-specialist'),
			'section'     => 'seo_specialist_additional_section',
			'type'        => 'checkbox',
		)
	);

	/*Pagination Select Type Option*/
	$wp_customize->add_setting('seo_specialist_pagination_type',array(
        'default' => 'type-1',
        'sanitize_callback' => 'seo_specialist_sanitize_choices'
	));
	$wp_customize->add_control('seo_specialist_pagination_type',array(
        'type' => 'select',
        'label' => esc_html__('Select Pagination Type','seo-specialist'),
        'section' => 'seo_specialist_additional_section',
        'choices' => array(
            'type-1' => esc_html__('Type 1','seo-specialist'),
            'type-2' => esc_html__('Type 2','seo-specialist'),
        ),
	) );

	/*Post layout*/
	$wp_customize->add_setting('seo_specialist_archive_layout',array(
		'default' => 'layout-1',
		'sanitize_callback' => 'seo_specialist_sanitize_choices'
	));
	$wp_customize->add_control('seo_specialist_archive_layout',array(
		'type' => 'select',
		'label' => esc_html__('Posts Layout','seo-specialist'),
		'section' => 'seo_specialist_additional_section',
		'choices' => array(
			'layout-1' => esc_html__('Sidebar On Right','seo-specialist'),
			'layout-2' => esc_html__('Sidebar On Left','seo-specialist'),
			'layout-3' => esc_html__('Full Width Layout','seo-specialist')
		),
	) );

	/*single post layout*/
	$wp_customize->add_setting('seo_specialist_post_layout',array(
		'default' => 'layout-1',
		'sanitize_callback' => 'seo_specialist_sanitize_choices'
	));
	$wp_customize->add_control('seo_specialist_post_layout',array(
		'type' => 'select',
		'label' => esc_html__('Single Post Layout','seo-specialist'),
		'section' => 'seo_specialist_additional_section',
		'choices' => array(
			'layout-1' => esc_html__('Sidebar On Right','seo-specialist'),
			'layout-2' => esc_html__('Sidebar On Left','seo-specialist'),
			'layout-3' => esc_html__('Full Width Layout','seo-specialist')
		),
	) );

	/*single page layout*/
	$wp_customize->add_setting('seo_specialist_page_layout',array(
		'default' => 'layout-1',
		'sanitize_callback' => 'seo_specialist_sanitize_choices'
	));
	$wp_customize->add_control('seo_specialist_page_layout',array(
		'type' => 'select',
		'label' => esc_html__('Single Page Layout','seo-specialist'),
		'section' => 'seo_specialist_additional_section',
		'choices' => array(
			'layout-1' => esc_html__('Sidebar On Right','seo-specialist'),
			'layout-2' => esc_html__('Sidebar On Left','seo-specialist'),
			'layout-3' => esc_html__('Full Width Layout','seo-specialist')
		),
	) );

	/*Archive Post Options*/
	$wp_customize->add_section('seo_specialist_blog_post_section', array(
		'priority'       => 5,
		'capability'     => 'edit_theme_options',
		'theme_supports' => '',
		'title'          => __('Blog Page Options', 'seo-specialist'),
		'panel'       => 'seo_specialist_panel',
	));

	$wp_customize->add_setting('seo_specialist_enable_blog_post_title',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 1,
		'sanitize_callback' => 'seo_specialist_sanitize_checkbox',
	));
	$wp_customize->add_control('seo_specialist_enable_blog_post_title',array(
		'label'       => __('Enable Blog Post Title', 'seo-specialist'),
		'description' => __('Checked To Show Blog Post Title', 'seo-specialist'),
		'section'     => 'seo_specialist_blog_post_section',
		'type'        => 'checkbox',
	));

	$wp_customize->add_setting('seo_specialist_enable_blog_post_meta',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 1,
		'sanitize_callback' => 'seo_specialist_sanitize_checkbox',
	));
	$wp_customize->add_control('seo_specialist_enable_blog_post_meta',array(
		'label'       => __('Enable Blog Post Meta', 'seo-specialist'),
		'description' => __('Checked To Show Blog Post Meta Feilds', 'seo-specialist'),
		'section'     => 'seo_specialist_blog_post_section',
		'type'        => 'checkbox',
	));

	$wp_customize->add_setting('seo_specialist_enable_blog_post_tags',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 1,
		'sanitize_callback' => 'seo_specialist_sanitize_checkbox',
	));
	$wp_customize->add_control('seo_specialist_enable_blog_post_tags',array(
		'label'       => __('Enable Blog Post Tags', 'seo-specialist'),
		'description' => __('Checked To Show Blog Post Tags', 'seo-specialist'),
		'section'     => 'seo_specialist_blog_post_section',
		'type'        => 'checkbox',
	));	

	$wp_customize->add_setting('seo_specialist_enable_blog_post_image',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 1,
		'sanitize_callback' => 'seo_specialist_sanitize_checkbox',
	));
	$wp_customize->add_control('seo_specialist_enable_blog_post_image',array(
		'label'       => __('Enable Blog Post Image', 'seo-specialist'),
		'description' => __('Checked To Show Blog Post Image', 'seo-specialist'),
		'section'     => 'seo_specialist_blog_post_section',
		'type'        => 'checkbox',
	));

	$wp_customize->add_setting('seo_specialist_enable_blog_post_content',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 1,
		'sanitize_callback' => 'seo_specialist_sanitize_checkbox',
	));
	$wp_customize->add_control('seo_specialist_enable_blog_post_content',array(
		'label'       => __('Enable Blog Post Content', 'seo-specialist'),
		'description' => __('Checked To Show Blog Post Content', 'seo-specialist'),
		'section'     => 'seo_specialist_blog_post_section',
		'type'        => 'checkbox',
	));

	$wp_customize->add_setting('seo_specialist_enable_blog_post_button',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 1,
		'sanitize_callback' => 'seo_specialist_sanitize_checkbox',
	));
	$wp_customize->add_control('seo_specialist_enable_blog_post_button',array(
		'label'       => __('Enable Blog Post Read More Button', 'seo-specialist'),
		'description' => __('Checked To Show Blog Post Read More Button', 'seo-specialist'),
		'section'     => 'seo_specialist_blog_post_section',
		'type'        => 'checkbox',
	));

	/*Blog post Content layout*/
	$wp_customize->add_setting('seo_specialist_blog_Post_content_layout',array(
		'default' => 'Left',
		'sanitize_callback' => 'seo_specialist_sanitize_choices'
	));
	$wp_customize->add_control('seo_specialist_blog_Post_content_layout',array(
		'type' => 'select',
		'label' => esc_html__('Blog Post Content Layout','seo-specialist'),
		'section' => 'seo_specialist_blog_post_section',
		'choices' => array(
			'Left' => esc_html__('Left','seo-specialist'),
			'Center' => esc_html__('Center','seo-specialist'),
			'Right' => esc_html__('Right','seo-specialist')
		),
	) );

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

	$wp_customize->add_control(
		'seo_specialist_excerpt_limit',
		array(
			'label'       => __('Excerpt Limit', 'seo-specialist'),
			'section'     => 'seo_specialist_blog_post_section',
			'type'        => 'number',
			'input_attrs' => array(
				'min' => 2,
				'max' => 50,
				'step' => 2,
			),
		)
	);

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

	$wp_customize->add_control(
		'seo_specialist_read_more_text',
		array(
			'label'       => __('Edit Button Text ', 'seo-specialist'),
			'section'     => 'seo_specialist_blog_post_section',
			'type'        => 'text',
		)
	);

	/*Single Post Options*/
	$wp_customize->add_section('seo_specialist_single_post_section', array(
		'priority'       => 5,
		'capability'     => 'edit_theme_options',
		'theme_supports' => '',
		'title'          => __('Single Post Options', 'seo-specialist'),
		'panel'       => 'seo_specialist_panel',
	));

	$wp_customize->add_setting('seo_specialist_enable_single_blog_post_title',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 1,
		'sanitize_callback' => 'seo_specialist_sanitize_checkbox',
	));
	$wp_customize->add_control('seo_specialist_enable_single_blog_post_title',array(
		'label'       => __('Enable Single Post Title', 'seo-specialist'),
		'description' => __('Checked To Show Single Blog Post Title', 'seo-specialist'),
		'section'     => 'seo_specialist_single_post_section',
		'type'        => 'checkbox',
	));

	$wp_customize->add_setting('seo_specialist_enable_single_blog_post_meta',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 1,
		'sanitize_callback' => 'seo_specialist_sanitize_checkbox',
	));
	$wp_customize->add_control('seo_specialist_enable_single_blog_post_meta',array(
		'label'       => __('Enable Single Post Meta', 'seo-specialist'),
		'description' => __('Checked To Show Single Blog Post Meta Feilds', 'seo-specialist'),
		'section'     => 'seo_specialist_single_post_section',
		'type'        => 'checkbox',
	));

	$wp_customize->add_setting('seo_specialist_enable_single_blog_post_tags',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 1,
		'sanitize_callback' => 'seo_specialist_sanitize_checkbox',
	));
	$wp_customize->add_control('seo_specialist_enable_single_blog_post_tags',array(
		'label'       => __('Enable Single Post Tags', 'seo-specialist'),
		'description' => __('Checked To Show Single Blog Post Tags', 'seo-specialist'),
		'section'     => 'seo_specialist_single_post_section',
		'type'        => 'checkbox',
	));

	$wp_customize->add_setting('seo_specialist_enable_single_post_image',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 1,
		'sanitize_callback' => 'seo_specialist_sanitize_checkbox',
	));
	$wp_customize->add_control('seo_specialist_enable_single_post_image',array(
		'label'       => __('Enable Single Post Image', 'seo-specialist'),
		'description' => __('Checked To Show Single Post Image', 'seo-specialist'),
		'section'     => 'seo_specialist_single_post_section',
		'type'        => 'checkbox',
	));

	$wp_customize->add_setting('seo_specialist_enable_single_blog_post_content',array(
		'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 1,
		'sanitize_callback' => 'seo_specialist_sanitize_checkbox',
	));
	$wp_customize->add_control('seo_specialist_enable_single_blog_post_content',array(
		'label'       => __('Enable Single Post Content', 'seo-specialist'),
		'description' => __('Checked To Show Single Blog Post Content', 'seo-specialist'),
		'section'     => 'seo_specialist_single_post_section',
		'type'        => 'checkbox',
	));

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

	$wp_customize->add_control(
		'seo_specialist_enable_related_post',
		array(
			'label'       => __('Enable Related Post', 'seo-specialist'),
			'description' => __('Checked to show Related Post', 'seo-specialist'),
			'section'     => 'seo_specialist_single_post_section',
			'type'        => 'checkbox',
		)
	);

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

	$wp_customize->add_control(
		'seo_specialist_related_post_text',
		array(
			'label'       => __('Edit Related Post Text ', 'seo-specialist'),
			'section'     => 'seo_specialist_single_post_section',
			'type'        => 'text',
		)
	);	

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

	$wp_customize->add_control(
		'seo_specialist_related_post_count',
		array(
			'label'       => __('Related Post Count', 'seo-specialist'),
			'section'     => 'seo_specialist_single_post_section',
			'type'        => 'number',
			'input_attrs' => array(
				'min' => 1,
				'max' => 9,
				'step' => 1,
			),
		)
	);

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

	$wp_customize->add_control(
		'seo_specialist_enable_comment_section',
		array(
			'label'       => __('Enable Comment Section', 'seo-specialist'),
			'description' => __('Checked to show Comment Section', 'seo-specialist'),
			'section'     => 'seo_specialist_single_post_section',
			'type'        => 'checkbox',
		)
	);

		/*
	* Customizer Global COlor
	*/

	/*Global Color Options*/
	$wp_customize->add_section('seo_specialist_global_color_section', array(
		'priority'       => 5,
		'capability'     => 'edit_theme_options',
		'theme_supports' => '',
		'title'          => __('Global Color Options', 'seo-specialist'),
		'panel'       => 'seo_specialist_panel',
	));

	$wp_customize->add_setting( 'seo_specialist_primary_color',
		array(
		'default'           => '#00c7ac',
		'capability'        => 'edit_theme_options',
		'sanitize_callback' => 'sanitize_hex_color',
		)
	);
	$wp_customize->add_control( 
		new WP_Customize_Color_Control( 
		$wp_customize, 
		'seo_specialist_primary_color',
		array(
			'label'      => esc_html__( 'Primary Color', 'seo-specialist' ),
			'section'    => 'seo_specialist_global_color_section',
			'settings'   => 'seo_specialist_primary_color',
		) ) 
	);

	$wp_customize->add_setting( 'seo_specialist_secondary_color',
		array(
		'default'           => '#001c27',
		'capability'        => 'edit_theme_options',
		'sanitize_callback' => 'sanitize_hex_color',
		)
	);
	$wp_customize->add_control( 
		new WP_Customize_Color_Control( 
		$wp_customize, 
		'seo_specialist_secondary_color',
		array(
			'label'      => esc_html__( 'Secondary Color', 'seo-specialist' ),
			'section'    => 'seo_specialist_global_color_section',
			'settings'   => 'seo_specialist_secondary_color',
		) ) 
	);

	/*Typography Options*/
	$wp_customize->add_section( 'seo_specialist_typography_section', array(
		'panel'       => 'seo_specialist_panel',
        'title'    => __( 'Typography Options', 'seo-specialist' ),
        'priority' => 2,
    ) );

    $wp_customize->add_setting( 'seo_specialist_font_family', array(
		'default'           => 'default',
		'sanitize_callback' => 'seo_specialist_sanitize_font_family',
	) );
	
	$wp_customize->add_control( 'seo_specialist_font_family', array(
		'label'    => __( 'Global Font Family', 'seo-specialist' ),
		'section'  => 'seo_specialist_typography_section',
		'type'     => 'select',
		'choices'  => array(
			'default'          => __( 'Default (Theme Font)', 'seo-specialist' ),
			'bad_script'       => 'Bad Script',
			'roboto'           => 'Roboto',
			'playfair_display' => 'Playfair Display',
			'open_sans'        => 'Open Sans',
			'lobster'          => 'Lobster',
			'merriweather'     => 'Merriweather',
			'oswald'           => 'Oswald',
			'raleway'          => 'Raleway',
			// Add new fonts here
			'poppins'            => 'Poppins',
			'lato'               => 'Lato',
			'source_sans_pro'    => 'Source Sans Pro',
			'quicksand'          => 'Quicksand',
			'nunito'             => 'Nunito',
			'montserrat'         => 'Montserrat',
			'roboto_condensed'   => 'Roboto Condensed',
			'playfair_display_sc'=> 'Playfair Display SC',
			'alegreya'           => 'Alegreya',
			'fira_sans'          => 'Fira Sans',
		),
	) );
	
	/*Main Header Options*/
	$wp_customize->add_section('seo_specialist_header_section', array(
		'priority'       => 5,
		'capability'     => 'edit_theme_options',
		'theme_supports' => '',
		'title'          => __('Main Header Options', 'seo-specialist'),
		'panel'       => 'seo_specialist_panel',
	));

	/*
	* Customizer top header section
	*/

	/*Main Header Options*/
	$wp_customize->add_section('seo_specialist_header_section', array(
		'priority'       => 5,
		'capability'     => 'edit_theme_options',
		'theme_supports' => '',
		'title'          => __('Main Header Options', 'seo-specialist'),
		'panel'       => 'seo_specialist_panel',
	));

	/*Main Header Address Text*/
	$wp_customize->add_setting(
		'seo_specialist_header_info_address',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 'Lorem ipsum dolor sit amet consectetur.',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);

	$wp_customize->add_control(
		'seo_specialist_header_info_address',
		array(
			'label'       => __('Edit Address ', 'seo-specialist'),
			'section'     => 'seo_specialist_header_section',
			'type'        => 'text',
		)
	);

	$wp_customize->add_setting('seo_specialist_header_location_icon',array(
		'default'	=> 'fas fa-location-arrow',
		'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control(new SEO_Specialist_Icon_Changer(
        $wp_customize,'seo_specialist_header_location_icon',array(
		'label'	=> __('Address Icon','seo-specialist'),
		'transport' => 'refresh',
		'section'	=> 'seo_specialist_header_section',
		'type'		=> 'icon'
	)));

	/*Facebook Link*/
	$wp_customize->add_setting(
		'seo_specialist_facebook_link_option',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => '#',
			'sanitize_callback' => 'esc_url_raw',
		)
	);

	$wp_customize->add_control(
		'seo_specialist_facebook_link_option',
		array(
			'label'       => __('Edit Facebook Link', 'seo-specialist'),
			'section'     => 'seo_specialist_header_section',
			'type'        => 'url',
		)
	);

	/*Twitter Link*/
	$wp_customize->add_setting(
		'seo_specialist_twitter_link_option',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => '#',
			'sanitize_callback' => 'esc_url_raw',
		)
	);

	$wp_customize->add_control(
		'seo_specialist_twitter_link_option',
		array(
			'label'       => __('Edit Twitter Link', 'seo-specialist'),
			'section'     => 'seo_specialist_header_section',
			'type'        => 'url',
		)
	);

	$wp_customize->add_setting(
		'seo_specialist_youtube_link_option',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => '#',
			'sanitize_callback' => 'esc_url_raw',
		)
	);
	$wp_customize->add_control(
		'seo_specialist_youtube_link_option',
		array(
			'label'       => __('Edit Youtube Link', 'seo-specialist'),
			'section'     => 'seo_specialist_header_section',
			'type'        => 'url',
		)
	);

	$wp_customize->add_setting(
		'seo_specialist_instagram_link_option',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => '#',
			'sanitize_callback' => 'esc_url_raw',
		)
	);

	$wp_customize->add_control(
		'seo_specialist_instagram_link_option',
		array(
			'label'       => __('Edit Instagram Link', 'seo-specialist'),
			'section'     => 'seo_specialist_header_section',
			'type'        => 'url',
		)
	);


	$wp_customize->add_setting(
		'seo_specialist_linkedin_link_option',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => '#',
			'sanitize_callback' => 'esc_url_raw',
		)
	);
	$wp_customize->add_control(
		'seo_specialist_linkedin_link_option',
		array(
			'label'       => __('Edit Linkedin Link', 'seo-specialist'),
			'section'     => 'seo_specialist_header_section',
			'type'        => 'url',
		)
	);

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

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

	/*
	* Customizer main slider section
	*/
	/*Main Slider Options*/
	$wp_customize->add_section('seo_specialist_slider_section', array(
		'priority'       => 5,
		'capability'     => 'edit_theme_options',
		'theme_supports' => '',
		'title'          => __('Main Slider Options', 'seo-specialist'),
		'panel'       => 'seo_specialist_panel',
	));

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

	$wp_customize->add_control(
		'seo_specialist_enable_slider',
		array(
			'label'       => __('Enable Main Slider', 'seo-specialist'),
			'description' => __('Checked to show the main slider', 'seo-specialist'),
			'section'     => 'seo_specialist_slider_section',
			'type'        => 'checkbox',
		)
	);

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

		/*Main Slider Image*/
		$wp_customize->add_setting(
			'seo_specialist_slider_image'.$seo_specialist_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, 
				'seo_specialist_slider_image'.$seo_specialist_i, 
				array(
			        'label' => __('Edit Slider Image ', 'seo-specialist') .$seo_specialist_i,
			        'description' => __('Edit the slider image.', 'seo-specialist'),
			        'section' => 'seo_specialist_slider_section',
				)
			)
		);

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

		$wp_customize->add_control(
			'seo_specialist_slider_heading'.$seo_specialist_i,
			array(
				'label'       => __('Edit Heading Text ', 'seo-specialist') .$seo_specialist_i,
				'description' => __('Edit the slider heading text.', 'seo-specialist'),
				'section'     => 'seo_specialist_slider_section',
				'type'        => 'text',
			)
		);

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

		$wp_customize->add_control(
			'seo_specialist_slider_text'.$seo_specialist_i,
			array(
				'label'       => __('Edit Content Text ', 'seo-specialist') .$seo_specialist_i,
				'description' => __('Edit the slider content text.', 'seo-specialist'),
				'section'     => 'seo_specialist_slider_section',
				'type'        => 'text',
			)
		);
	}

	/*
	* Customizer Blog section
	*/
	/*Blog Options*/
	$wp_customize->add_section('seo_specialist_events_section', array(
		'priority'       => 5,
		'capability'     => 'edit_theme_options',
		'theme_supports' => '',
		'title'          => __('Our Best Gallery Options', 'seo-specialist'),
		'panel'       => 'seo_specialist_panel',
	));

	/*Blog Enable Option*/
	$wp_customize->add_setting(
		'seo_specialist_enable_event',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 0,
			'sanitize_callback' => 'seo_specialist_sanitize_checkbox',
		)
	);

	$wp_customize->add_control(
		'seo_specialist_enable_event',
		array(
			'label'       => __('Enable Our Best Gallery Section', 'seo-specialist'),
			'description' => __('Checked to show the category', 'seo-specialist'),
			'section'     => 'seo_specialist_events_section',
			'type'        => 'checkbox',
		)
	);

	/*Blog Text*/
	$wp_customize->add_setting(
		'seo_specialist_event_text',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => '',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);

	$wp_customize->add_control(
		'seo_specialist_event_text',
		array(
			'label'       => __('Edit Section Text', 'seo-specialist'),
			'description' => __('Edit Our Best Gallery section text', 'seo-specialist'),
			'section'     => 'seo_specialist_events_section',
			'type'        => 'text',
		)
	);


	$seo_specialist_categories = get_categories();
	$seo_specialist_cats = array();
	$seo_specialist_i = 0;
	$cat_pst1[]= 'select';
	foreach($seo_specialist_categories as $seo_specialist_category){
		if($seo_specialist_i==0){
			$seo_specialist_default = $seo_specialist_category->slug;
			$seo_specialist_i++;
		}
		$cat_pst1[$seo_specialist_category->slug] = $seo_specialist_category->name;
	}

	$wp_customize->add_setting(
		'seo_specialist_blog_cat',
		array(
		    'default' => 'uncategorized',
		    'sanitize_callback' => 'seo_specialist_sanitize_choices',
  		)
  	);

  	$wp_customize->add_control(
  		'seo_specialist_blog_cat',
  		array(
		    'type'    => 'select',
		    'choices' => $cat_pst1,
		    'label' => __('Select Category to display Our Best Gallery','seo-specialist'),
		    'section' => 'seo_specialist_events_section',
		)
	);

	/*
	* Customizer Footer Section
	*/
	/*Footer Options*/
	$wp_customize->add_section('seo_specialist_footer_section', array(
		'priority'       => 5,
		'capability'     => 'edit_theme_options',
		'theme_supports' => '',
		'title'          => __('Footer Options', 'seo-specialist'),
		'panel'       => 'seo_specialist_panel',
	));

	/*Footer Enable Option*/
	$wp_customize->add_setting(
		'seo_specialist_enable_footer',
		array(
			'capability'        => 'edit_theme_options',
			'transport'         => 'refresh',
			'default'           => 1,
			'sanitize_callback' => 'seo_specialist_sanitize_checkbox',
		)
	);
	$wp_customize->add_control(
		'seo_specialist_enable_footer',
		array(
			'label'       => __('Enable Footer', 'seo-specialist'),
			'description' => __('Checked to show Footer', 'seo-specialist'),
			'section'     => 'seo_specialist_footer_section',
			'type'        => 'checkbox',
		)
	);

	/*Footer bg image Option*/
	$wp_customize->add_setting('seo_specialist_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,'seo_specialist_footer_bg_image',array(
        'label' => __('Footer Background Image','seo-specialist'),
        'section' => 'seo_specialist_footer_section',
    )));

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

    $wp_customize->add_control('seo_specialist_background_attachment', array(
        'label'    => __('Footer Background Attachment', 'seo-specialist'),
        'section'  => 'seo_specialist_footer_section',
        'settings' => 'seo_specialist_background_attachment',
        'type'     => 'select',
        'choices'  => array(
            'fixed' => __('fixed','seo-specialist'),
            'scroll' => __('scroll','seo-specialist'),
        ),
    ));

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

	$wp_customize->add_control(
		'seo_specialist_footer_social_menu',
		array(
			'label'       => __('Enable Footer Social Menu', 'seo-specialist'),
			'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.', 'seo-specialist'),
			'section'     => 'seo_specialist_footer_section',
			'type'        => 'checkbox',
		)
	);	

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

	$wp_customize->add_control(
		'seo_specialist_enable_go_to_top_option',
		array(
			'label'       => __('Enable Go To Top', 'seo-specialist'),
			'description' => __('Checked to enable Go To Top option.', 'seo-specialist'),
			'section'     => 'seo_specialist_footer_section',
			'type'        => 'checkbox',
		)
	);

	$wp_customize->add_setting('seo_specialist_go_to_top_position',array(
        'capability'        => 'edit_theme_options',
		'transport'         => 'refresh',
		'default'           => 'Right',
        'sanitize_callback' => 'seo_specialist_sanitize_choices'
    ));
    $wp_customize->add_control('seo_specialist_go_to_top_position',array(
        'type' => 'select',
        'section' => 'seo_specialist_footer_section',
        'label' => esc_html__('Go To Top Positions','seo-specialist'),
        'choices' => array(
            'Right' => __('Right','seo-specialist'),
            'Left' => __('Left','seo-specialist'),
            'Center' => __('Center','seo-specialist')
        ),
    ) );

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

	$wp_customize->add_control(
		'seo_specialist_copyright_option',
		array(
			'label'       => __('Edit Copyright Text', 'seo-specialist'),
			'description' => __('Edit the Footer Copyright Section.', 'seo-specialist'),
			'section'     => 'seo_specialist_footer_section',
			'type'        => 'text',
		)
	);
}
add_action( 'customize_register', 'Seo_Specialist_Customize_register' );

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

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

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

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

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

		static $seo_specialist_instance = null;

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

		return $seo_specialist_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  $seo_specialist_manager
	 * @return void
	*/
	public function sections( $seo_specialist_manager ) {
		// Load custom sections.
		load_template( trailingslashit( get_template_directory() ) . '/revolution/inc/section-pro.php' );

		// Register custom section types.
		$seo_specialist_manager->register_section_type( 'seo_specialist_Customize_Section_Pro' );

		// Register sections.
		$seo_specialist_manager->add_section( new SEO_SPECIALIST_Customize_Section_Pro( $seo_specialist_manager,'seo_specialist_go_pro', array(
			'priority'   => 1,
			'title'    => esc_html__( 'SEO Specialist Pro', 'seo-specialist' ),
			'pro_text' => esc_html__( 'Buy Pro', 'seo-specialist' ),
			'pro_url'    => esc_url( SEO_SPECIALIST_BUY_NOW ),
		) )	);

		// Register sections.
		$seo_specialist_manager->add_section( new SEO_SPECIALIST_Customize_Section_Pro( $seo_specialist_manager,'seo_specialist_lite_documentation', array(
			'priority'   => 1,
			'title'    => esc_html__( 'Lite Documentation', 'seo-specialist' ),
			'pro_text' => esc_html__( 'Instruction', 'seo-specialist' ),
			'pro_url'    => esc_url( SEO_SPECIALIST_LITE_DOC ),
		) )	);

		$seo_specialist_manager->add_section( new SEO_SPECIALIST_Customize_Section_Pro( $seo_specialist_manager, 'seo_specialist_live_demo', array(
		    'priority'   => 1,
		    'title'      => esc_html__( 'Pro Theme Demo', 'seo-specialist' ),
		    'pro_text'   => esc_html__( 'Live Preview', 'seo-specialist' ),
		    'pro_url'    => esc_url( SEO_SPECIALIST_LIVE_DEMO ),
		) ) );	
	}

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

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

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

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