<?php
/**
 * Digital Marketing Expert: Customizer
 *
 * @subpackage Digital Marketing Expert
 * @since 1.0
 */

use WPTRT\Customize\Section\Digital_Marketing_Expert_Button;

add_action( 'customize_register', function( $manager ) {

	$manager->register_section_type( Digital_Marketing_Expert_Button::class );

	$manager->add_section(
		new Digital_Marketing_Expert_Button( $manager, 'digital_marketing_expert_pro', [
			'title' => __( 'Digital Marketing Pro', 'digital-marketing-expert' ),
			'priority' => 0,
			'button_text' => __( 'Go Pro', 'digital-marketing-expert' ),
			'button_url'  => esc_url( 'https://www.luzuk.com/product/wordpress-digital-marketing-theme/', 'digital-marketing-expert')
		] )
	);

} );

// Load the JS and CSS.
add_action( 'customize_controls_enqueue_scripts', function() {

	$version = wp_get_theme()->get( 'Version' );

	wp_enqueue_script(
		'digital-marketing-expert-customize-section-button',
		get_theme_file_uri( 'vendor/wptrt/customize-section-button/public/js/customize-controls.js' ),
		[ 'customize-controls' ],
		$version,
		true
	);

	wp_enqueue_style(
		'digital-marketing-expert-customize-section-button',
		get_theme_file_uri( 'vendor/wptrt/customize-section-button/public/css/customize-controls.css' ),
		[ 'customize-controls' ],
 		$version
	);

} );

function digital_marketing_expert_customize_register( $wp_customize ) {

	$wp_customize->add_setting('digital_marketing_expert_logo_size',array(
		'default' => '',
		'sanitize_callback'	=> 'digital_marketing_expert_sanitize_float'
	));
	$wp_customize->add_control('digital_marketing_expert_logo_size',array(
		'type' => 'range',
		'description' => __('Logo Size (0-100%)','digital-marketing-expert'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('digital_marketing_expert_logo_padding',array(
		'sanitize_callback'	=> 'esc_html'
	));
	$wp_customize->add_control('digital_marketing_expert_logo_padding',array(
		'label' => __('Logo Margin','digital-marketing-expert'),
		'section' => 'title_tagline'
	));

	$wp_customize->add_setting('digital_marketing_expert_logo_top_padding',array(
		'default' => '',
		'sanitize_callback'	=> 'digital_marketing_expert_sanitize_float'
	));
	$wp_customize->add_control('digital_marketing_expert_logo_top_padding',array(
		'type' => 'number',
		'description' => __('Top','digital-marketing-expert'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('digital_marketing_expert_logo_bottom_padding',array(
		'default' => '',
		'sanitize_callback'	=> 'digital_marketing_expert_sanitize_float'
	));
	$wp_customize->add_control('digital_marketing_expert_logo_bottom_padding',array(
		'type' => 'number',
		'description' => __('Bottom','digital-marketing-expert'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('digital_marketing_expert_logo_left_padding',array(
		'default' => '',
		'sanitize_callback'	=> 'digital_marketing_expert_sanitize_float'
	));
	$wp_customize->add_control('digital_marketing_expert_logo_left_padding',array(
		'type' => 'number',
		'description' => __('Left','digital-marketing-expert'),
		'section' => 'title_tagline',
	));

	$wp_customize->add_setting('digital_marketing_expert_logo_right_padding',array(
		'default' => '',
		'sanitize_callback'	=> 'digital_marketing_expert_sanitize_float'
 	));
 	$wp_customize->add_control('digital_marketing_expert_logo_right_padding',array(
		'type' => 'number',
		'description' => __('Right','digital-marketing-expert'),
		'section' => 'title_tagline',
    ));

	$wp_customize->add_setting('digital_marketing_expert_show_site_title',array(
		'default' => true,
		'sanitize_callback'	=> 'digital_marketing_expert_sanitize_checkbox'
	));
	$wp_customize->add_control('digital_marketing_expert_show_site_title',array(
		'type' => 'checkbox',
		'label' => __('Show / Hide Site Title','digital-marketing-expert'),
		'section' => 'title_tagline'
	));

	$wp_customize->add_setting( 'digital_marketing_expert_site_title_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'digital_marketing_expert_site_title_color', array(
		'label' => 'Title Color',
		'section' => 'title_tagline',
	)));

	$wp_customize->add_setting('digital_marketing_expert_show_tagline',array(
		'default' => true,
		'sanitize_callback'	=> 'digital_marketing_expert_sanitize_checkbox'
	));
	$wp_customize->add_control('digital_marketing_expert_show_tagline',array(
		'type' => 'checkbox',
		'label' => __('Show / Hide Site Tagline','digital-marketing-expert'),
		'section' => 'title_tagline'
	));

	$wp_customize->add_setting( 'digital_marketing_expert_site_tagline_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'digital_marketing_expert_site_tagline_color', array(
		'label' => 'Tagline Color',
		'section' => 'title_tagline',
	)));

	$wp_customize->add_panel( 'digital_marketing_expert_panel_id', array(
		'priority' => 10,
		'capability' => 'edit_theme_options',
		'theme_supports' => '',
		'title' => __( 'Theme Settings', 'digital-marketing-expert' ),
		'description' => __( 'Description of what this panel does.', 'digital-marketing-expert' ),
	) );

	$wp_customize->add_section( 'digital_marketing_expert_theme_options_section', array(
    	'title'      => __( 'General Settings', 'digital-marketing-expert' ),
		'priority'   => 30,
		'panel' => 'digital_marketing_expert_panel_id'
	) );

	$wp_customize->add_setting('digital_marketing_expert_theme_options',array(
		'default' => 'Right Sidebar',
		'sanitize_callback' => 'digital_marketing_expert_sanitize_choices'
	));
	$wp_customize->add_control('digital_marketing_expert_theme_options',array(
		'type' => 'select',
		'label' => __('Blog Page Sidebar Layout','digital-marketing-expert'),
		'section' => 'digital_marketing_expert_theme_options_section',
		'choices' => array(
		   'Left Sidebar' => __('Left Sidebar','digital-marketing-expert'),
		   'Right Sidebar' => __('Right Sidebar','digital-marketing-expert'),
		   'One Column' => __('One Column','digital-marketing-expert'),
		   'Grid Layout' => __('Grid Layout','digital-marketing-expert')
		),
	));

	$wp_customize->add_setting('digital_marketing_expert_single_post_sidebar',array(
		'default' => 'Right Sidebar',
		'sanitize_callback' => 'digital_marketing_expert_sanitize_choices'
	));
	$wp_customize->add_control('digital_marketing_expert_single_post_sidebar',array(
        'type' => 'select',
        'label' => __('Single Post Sidebar Layout','digital-marketing-expert'),
        'section' => 'digital_marketing_expert_theme_options_section',
        'choices' => array(
            'Left Sidebar' => __('Left Sidebar','digital-marketing-expert'),
            'Right Sidebar' => __('Right Sidebar','digital-marketing-expert'),
            'One Column' => __('One Column','digital-marketing-expert')
        ),
	));

	$wp_customize->add_setting('digital_marketing_expert_page_sidebar',array(
		'default' => 'One Column',
		'sanitize_callback' => 'digital_marketing_expert_sanitize_choices'
	));
	$wp_customize->add_control('digital_marketing_expert_page_sidebar',array(
        'type' => 'select',
        'label' => __('Page Sidebar Layout','digital-marketing-expert'),
        'section' => 'digital_marketing_expert_theme_options_section',
        'choices' => array(
            'Left Sidebar' => __('Left Sidebar','digital-marketing-expert'),
            'Right Sidebar' => __('Right Sidebar','digital-marketing-expert'),
            'One Column' => __('One Column','digital-marketing-expert')
        ),
	));

	$wp_customize->add_setting('digital_marketing_expert_archive_page_sidebar',array(
		'default' => 'Right Sidebar',
		'sanitize_callback' => 'digital_marketing_expert_sanitize_choices'
	));
	$wp_customize->add_control('digital_marketing_expert_archive_page_sidebar',array(
        'type' => 'select',
        'label' => __('Archive & Search Page Sidebar Layout','digital-marketing-expert'),
        'section' => 'digital_marketing_expert_theme_options_section',
        'choices' => array(
            'Left Sidebar' => __('Left Sidebar','digital-marketing-expert'),
            'Right Sidebar' => __('Right Sidebar','digital-marketing-expert'),
            'One Column' => __('One Column','digital-marketing-expert'),
            'Grid Layout' => __('Grid Layout','digital-marketing-expert')
        ),
	));

	$wp_customize->add_setting( 'digital_marketing_expert_boxfull_width', array(
		'default'           => '',
		'sanitize_callback' => 'digital_marketing_expert_sanitize_choices'
	));
	
	$wp_customize->add_control( 'digital_marketing_expert_boxfull_width', array(
		'label'    => __( 'Section Width', 'digital-marketing-expert' ),
		'section'  => 'digital_marketing_expert_theme_options_section',
		'type'     => 'select',
		'choices'  => array(
			'container'  => __('Box Width', 'digital-marketing-expert'),
			'container-fluid' => __('Full Width', 'digital-marketing-expert'),
			'none' => __('None', 'digital-marketing-expert')
		),
	));

	$wp_customize->add_setting( 'digital_marketing_expert_dropdown_anim', array(
		'default'           => 'None',
		'sanitize_callback' => 'digital_marketing_expert_sanitize_choices'
	));
	$wp_customize->add_control( 'digital_marketing_expert_dropdown_anim', array(
		'label'    => __( 'Menu Dropdown Animations', 'digital-marketing-expert' ),
		'section'  => 'digital_marketing_expert_theme_options_section',
		'type'     => 'select',
		'choices'  => array(
			'bounceInUp'  => __('bounceInUp', 'digital-marketing-expert'),
			'fadeInUp' => __('fadeInUp', 'digital-marketing-expert'),
			'zoomIn'    => __('zoomIn', 'digital-marketing-expert'),
			'None'    => __('None', 'digital-marketing-expert')
		),
	));

	//Header
	$wp_customize->add_section( 'digital_marketing_expert_header_section' , array(
    	'title'    => __( 'Header', 'digital-marketing-expert' ),
		'priority' => null,
		'panel' => 'digital_marketing_expert_panel_id'
	) );

	$wp_customize->add_setting('digital_marketing_expert_contact_btn_text',array(
    	'default' => '',
    	'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('digital_marketing_expert_contact_btn_text',array(
	   	'type' => 'text',
	   	'label' => __('Add Contact Button Text','digital-marketing-expert'),
	   	'section' => 'digital_marketing_expert_header_section',
	));

	$wp_customize->add_setting('digital_marketing_expert_contact_btn_url',array(
    	'default' => '',
    	'sanitize_callback'	=> 'esc_url_raw'
	));
	$wp_customize->add_control('digital_marketing_expert_contact_btn_url',array(
	   	'type' => 'text',
	   	'label' => __('Add Contact Button URL','digital-marketing-expert'),
	   	'section' => 'digital_marketing_expert_header_section',
	));

	$wp_customize->add_setting('digital_marketing_expert_facebook_url',array(
    	'default' => '',
    	'sanitize_callback'	=> 'esc_url_raw'
	));
	$wp_customize->add_control('digital_marketing_expert_facebook_url',array(
	   	'type' => 'url',
	   	'label' => __('Add Facebook URL','digital-marketing-expert'),
	   	'section' => 'digital_marketing_expert_header_section',
	));

	$wp_customize->add_setting('digital_marketing_expert_instagram_url',array(
    	'default' => '',
    	'sanitize_callback'	=> 'esc_url_raw'
	));
	$wp_customize->add_control('digital_marketing_expert_instagram_url',array(
	   	'type' => 'url',
	   	'label' => __('Add Instagram URL','digital-marketing-expert'),
	   	'section' => 'digital_marketing_expert_header_section',
	));

	$wp_customize->add_setting('digital_marketing_expert_twitter_url',array(
    	'default' => '',
    	'sanitize_callback'	=> 'esc_url_raw'
	));
	$wp_customize->add_control('digital_marketing_expert_twitter_url',array(
	   	'type' => 'url',
	   	'label' => __('Add Twitter URL','digital-marketing-expert'),
	   	'section' => 'digital_marketing_expert_header_section',
	));

	$wp_customize->add_setting('digital_marketing_expert_linkedin_url',array(
    	'default' => '',
    	'sanitize_callback'	=> 'esc_url_raw'
	));
	$wp_customize->add_control('digital_marketing_expert_linkedin_url',array(
	   	'type' => 'url',
	   	'label' => __('Add Linkedin URL','digital-marketing-expert'),
	   	'section' => 'digital_marketing_expert_header_section',
	));

	$wp_customize->add_setting( 'digital_marketing_expert_social_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'digital_marketing_expert_social_color', array(
		'label' => 'Social Icon Color',
		'section' => 'digital_marketing_expert_header_section',
	)));

	$wp_customize->add_setting( 'digital_marketing_expert_socialbg_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'digital_marketing_expert_socialbg_color', array(
		'label' => 'Social Icon Background Color',
		'section' => 'digital_marketing_expert_header_section',
	)));

	$wp_customize->add_setting( 'digital_marketing_expert_hdrbtn_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'digital_marketing_expert_hdrbtn_color', array(
		'label' => 'Button Text Color',
		'section' => 'digital_marketing_expert_header_section',
	)));

	$wp_customize->add_setting( 'digital_marketing_expert_hdrbtnbg_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'digital_marketing_expert_hdrbtnbg_color', array(
		'label' => 'Button Background Color',
		'section' => 'digital_marketing_expert_header_section',
	)));

	$wp_customize->add_setting( 'digital_marketing_expert_menu_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'digital_marketing_expert_menu_color', array(
		'label' => 'Menu Color',
		'section' => 'digital_marketing_expert_header_section',
	)));

	//home page slider
	$wp_customize->add_section( 'digital_marketing_expert_slider_section' , array(
    	'title'    => __( 'Slider Settings', 'digital-marketing-expert' ),
		'priority' => null,
		'panel' => 'digital_marketing_expert_panel_id'
	) );

	$wp_customize->add_setting('digital_marketing_expert_slider_hide_show',array(
    	'default' => false,
    	'sanitize_callback'	=> 'digital_marketing_expert_sanitize_checkbox'
	));
	$wp_customize->add_control('digital_marketing_expert_slider_hide_show',array(
	   	'type' => 'checkbox',
	   	'label' => __('Show / Hide Slider','digital-marketing-expert'),
	   	'section' => 'digital_marketing_expert_slider_section',
	));

	$wp_customize->add_setting( 'digital_marketing_expert_slider_effect', array(
		'default'           => '',
		'sanitize_callback' => 'digital_marketing_expert_sanitize_choices'
	));
	$wp_customize->add_control( 'digital_marketing_expert_slider_effect', array(
		'label'    => __( 'Onload Transactions Effects', 'digital-marketing-expert' ),
		'section'  => 'digital_marketing_expert_slider_section',
		'type'     => 'select',
		'choices'  => array(
			'bounceInLeft'  => __('bounceInLeft', 'digital-marketing-expert'),
			'bounceInRight' => __('bounceInRight', 'digital-marketing-expert'),
			'bounceInUp'    => __('bounceInUp', 'digital-marketing-expert'),
			'bounceInDown'    => __('bounceInDown', 'digital-marketing-expert'),
			'zoomIn'  => __('zoomIn', 'digital-marketing-expert'),
			'zoomOut' => __('zoomOut', 'digital-marketing-expert'),
			'fadeInDown'    => __('fadeInDown', 'digital-marketing-expert'),
			'fadeInUp'    => __('fadeInUp', 'digital-marketing-expert'),
			'fadeInLeft'  => __('fadeInLeft', 'digital-marketing-expert'),
			'fadeInRight' => __('fadeInRight', 'digital-marketing-expert'),
			'flip-up'    => __('flip-up', 'digital-marketing-expert'),
			'none'    => __('none', 'digital-marketing-expert')
		),
	));

	for ( $count = 1; $count <= 4; $count++ ) {
		$wp_customize->add_setting( 'digital_marketing_expert_slider' . $count, array(
			'default'           => '',
			'sanitize_callback' => 'digital_marketing_expert_sanitize_dropdown_pages'
		));
		$wp_customize->add_control( 'digital_marketing_expert_slider' . $count, array(
			'label' => __('Select Slider Image Page', 'digital-marketing-expert' ),
			'description'=> __('Image size (500px x 500px)','digital-marketing-expert'),
			'section' => 'digital_marketing_expert_slider_section',
			'type' => 'dropdown-pages'
		));
	}

	$wp_customize->add_setting('digital_marketing_expert_slider_excerpt_length',array(
		'default' => '15',
		'sanitize_callback'	=> 'digital_marketing_expert_sanitize_float'
	));
	$wp_customize->add_control('digital_marketing_expert_slider_excerpt_length',array(
		'type' => 'number',
		'label' => __('Slider Excerpt Length','digital-marketing-expert'),
		'section' => 'digital_marketing_expert_slider_section',
	));

	$wp_customize->add_setting('digital_marketing_expert_slider_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'digital_marketing_expert_sanitize_float'
	));
	$wp_customize->add_control('digital_marketing_expert_slider_font_size',array(
		'type' => 'number',
		'label' => __('Title Font Size','digital-marketing-expert'),
		'section' => 'digital_marketing_expert_slider_section',
	));

	$wp_customize->add_setting('digital_marketing_expert_slider_text_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'digital_marketing_expert_sanitize_float'
	));
	$wp_customize->add_control('digital_marketing_expert_slider_text_font_size',array(
		'type' => 'number',
		'label' => __('Text Font Size','digital-marketing-expert'),
		'section' => 'digital_marketing_expert_slider_section',
	));

	$wp_customize->add_setting('digital_marketing_expert_slider_opacity',array(
		'default' => '',
		'sanitize_callback'	=> 'digital_marketing_expert_sanitize_float'
	));
	$wp_customize->add_control('digital_marketing_expert_slider_opacity',array(
		'type' => 'range',
		'label' => __('Dots Opacity','digital-marketing-expert'),
		'section' => 'digital_marketing_expert_slider_section',
		'input_attrs' => array(
			'min' => 0,
			'max' => 1,
			'step' => 0.1,
		),
	));

	$wp_customize->add_setting( 'digital_marketing_expert_slidertitle_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'digital_marketing_expert_slidertitle_color', array(
		'label' => 'Title Color',
		'section' => 'digital_marketing_expert_slider_section',
	)));

	$wp_customize->add_setting( 'digital_marketing_expert_slidertext_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'digital_marketing_expert_slidertext_color', array(
		'label' => 'Text Color',
		'section' => 'digital_marketing_expert_slider_section',
	)));

	$wp_customize->add_setting( 'digital_marketing_expert_sliderbtn_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'digital_marketing_expert_sliderbtn_color', array(
		'label' => 'Button Text Color',
		'section' => 'digital_marketing_expert_slider_section',
	)));

	$wp_customize->add_setting( 'digital_marketing_expert_sliderbtnbg_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'digital_marketing_expert_sliderbtnbg_color', array(
		'label' => 'Button Bg Color',
		'section' => 'digital_marketing_expert_slider_section',
	)));

	$wp_customize->add_setting( 'digital_marketing_expert_sliderbtnhvr_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'digital_marketing_expert_sliderbtnhvr_color', array(
		'label' => 'Button hover Text Color',
		'section' => 'digital_marketing_expert_slider_section',
	)));

	$wp_customize->add_setting( 'digital_marketing_expert_sliderbtnhvrbg_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'digital_marketing_expert_sliderbtnhvrbg_color', array(
		'label' => 'Button hover Bg Color',
		'section' => 'digital_marketing_expert_slider_section',
	)));

	//Services Section
	$wp_customize->add_section('digital_marketing_expert_service_section',array(
		'title'	=> __('Service Section','digital-marketing-expert'),
		'description'=> __('<b>Note :</b> This section will appear below the slider.','digital-marketing-expert'),
		'panel' => 'digital_marketing_expert_panel_id',
	));

    $wp_customize->add_setting('digital_marketing_expert_section_title',array(
		'default' => '',
		'sanitize_callback'	=> 'sanitize_text_field'
	));	
	$wp_customize->add_control('digital_marketing_expert_section_title',array(
		'label'	=> __('Section Title','digital-marketing-expert'),
		'section' => 'digital_marketing_expert_service_section',
		'type' => 'text'
	));

	$wp_customize->add_setting('digital_marketing_expert_section_title_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'digital_marketing_expert_sanitize_float'
	));
	$wp_customize->add_control('digital_marketing_expert_section_title_font_size',array(
		'type' => 'number',
		'label' => __('Font Size','digital-marketing-expert'),
		'section' => 'digital_marketing_expert_service_section',
	));

    $wp_customize->add_setting('digital_marketing_expert_section_text',array(
		'default' => '',
		'sanitize_callback'	=> 'sanitize_text_field'
	));	
	$wp_customize->add_control('digital_marketing_expert_section_text',array(
		'label'	=> __('Section Text','digital-marketing-expert'),
		'section' => 'digital_marketing_expert_service_section',
		'type' => 'text'
	));

	$wp_customize->add_setting('digital_marketing_expert_section_text_font_size',array(
		'default' => '',
		'sanitize_callback'	=> 'digital_marketing_expert_sanitize_float'
	));
	$wp_customize->add_control('digital_marketing_expert_section_text_font_size',array(
		'type' => 'number',
		'label' => __('Font Size','digital-marketing-expert'),
		'section' => 'digital_marketing_expert_service_section',
	));

	$categories = get_categories();
	$cats = array();
	$i = 0;
	$cat_pst[]= 'select';
	foreach($categories as $category){
		if($i==0){
			$default = $category->slug;
			$i++;
		}
		$cat_pst[$category->slug] = $category->name;
	}

	$wp_customize->add_setting('digital_marketing_expert_category_setting',array(
		'default' => 'select',
		'sanitize_callback' => 'digital_marketing_expert_sanitize_choices',
	));
	$wp_customize->add_control('digital_marketing_expert_category_setting',array(
		'type' => 'select',
		'choices' => $cat_pst,
		'label' => __('Select Category To Display Post','digital-marketing-expert'),
		'section' => 'digital_marketing_expert_service_section',
	));

	$wp_customize->add_setting('digital_marketing_expert_service_excerpt_length',array(
		'default' => '15',
		'sanitize_callback'	=> 'digital_marketing_expert_sanitize_float'
	));
	$wp_customize->add_control('digital_marketing_expert_service_excerpt_length',array(
		'type' => 'number',
		'label' => __('Service Excerpt Length','digital-marketing-expert'),
		'section' => 'digital_marketing_expert_service_section',
	));

	$wp_customize->add_setting( 'digital_marketing_expert_service_section_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'digital_marketing_expert_service_section_color', array(
		'label' => 'Section Title Color',
		'section' => 'digital_marketing_expert_service_section',
	)));

	$wp_customize->add_setting( 'digital_marketing_expert_service_section_text_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'digital_marketing_expert_service_section_text_color', array(
		'label' => 'Section Text Color',
		'section' => 'digital_marketing_expert_service_section',
	)));

	$wp_customize->add_setting( 'digital_marketing_expert_service_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'digital_marketing_expert_service_color', array(
		'label' => 'Title Color',
		'section' => 'digital_marketing_expert_service_section',
	)));

	$wp_customize->add_setting( 'digital_marketing_expert_service_text_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'digital_marketing_expert_service_text_color', array(
		'label' => 'Text Color',
		'section' => 'digital_marketing_expert_service_section',
	)));

	$wp_customize->add_setting( 'digital_marketing_expert_service_btn_color', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'digital_marketing_expert_service_btn_color', array(
		'label' => 'Button Text Color',
		'section' => 'digital_marketing_expert_service_section',
	)));

	$wp_customize->add_setting( 'digital_marketing_expert_service_btnbg_color1', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'digital_marketing_expert_service_btnbg_color1', array(
		'label' => 'Button Bg Color 1',
		'section' => 'digital_marketing_expert_service_section',
	)));

	$wp_customize->add_setting( 'digital_marketing_expert_service_btnbg_color2', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'digital_marketing_expert_service_btnbg_color2', array(
		'label' => 'Button Bg Color 2',
		'section' => 'digital_marketing_expert_service_section',
	)));

	$wp_customize->add_setting( 'digital_marketing_expert_service_btnbg_color3', array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color'
	));
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'digital_marketing_expert_service_btnbg_color3', array(
		'label' => 'Button Bg Color 3',
		'section' => 'digital_marketing_expert_service_section',
	)));

	//Footer
    $wp_customize->add_section( 'digital_marketing_expert_footer', array(
    	'title'  => __( 'Footer Setting', 'digital-marketing-expert' ),
		'priority' => null,
		'panel' => 'digital_marketing_expert_panel_id'
	) );

	$wp_customize->add_setting('digital_marketing_expert_show_back_totop',array(
       'default' => true,
       'sanitize_callback'	=> 'digital_marketing_expert_sanitize_checkbox'
    ));
    $wp_customize->add_control('digital_marketing_expert_show_back_totop',array(
       'type' => 'checkbox',
       'label' => __('Show / Hide Back to Top','digital-marketing-expert'),
       'section' => 'digital_marketing_expert_footer'
    ));

    $wp_customize->add_setting('digital_marketing_expert_footer_link',array(
		'default' => 'https://www.luzuk.com/themes/free-wordpress-digital-marketing-theme/',
		'sanitize_callback'	=> 'sanitize_text_field'
	));	
	$wp_customize->add_control('digital_marketing_expert_footer_link',array(
		'label'	=> __('Copyright Link','digital-marketing-expert'),
		'section' => 'digital_marketing_expert_footer',
		'setting' => 'digital_marketing_expert_footer_link',
		'type' => 'text'
	));

	$wp_customize->add_setting('digital_marketing_expert_footer_copy',array(
		'default' => 'Digital Marketing WordPress Theme By Luzuk',
		'sanitize_callback'	=> 'sanitize_text_field'
	));	
	$wp_customize->add_control('digital_marketing_expert_footer_copy',array(
		'label'	=> __('Copyright Text','digital-marketing-expert'),
		'section' => 'digital_marketing_expert_footer',
		'setting' => 'digital_marketing_expert_footer_copy',
		'type' => 'text'
	));

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

	$wp_customize->selective_refresh->add_partial( 'blogname', array(
		'selector' => '.site-title a',
		'render_callback' => 'digital_marketing_expert_customize_partial_blogname',
	) );
	$wp_customize->selective_refresh->add_partial( 'blogdescription', array(
		'selector' => '.site-description',
		'render_callback' => 'digital_marketing_expert_customize_partial_blogdescription',
	) );
}
add_action( 'customize_register', 'digital_marketing_expert_customize_register' );

function digital_marketing_expert_customize_partial_blogname() {
	bloginfo( 'name' );
}

function digital_marketing_expert_customize_partial_blogdescription() {
	bloginfo( 'description' );
}

function digital_marketing_expert_is_static_front_page() {
	return ( is_front_page() && ! is_home() );
}

function digital_marketing_expert_is_view_with_layout_option() {
	// This option is available on all pages. It's also available on archives when there isn't a sidebar.
	return ( is_page() || ( is_archive() && ! is_active_sidebar( 'sidebar-1' ) ) );
}