<?php   
/**
 * Createing a bog pannel for customizer
 *
 *
 */
$lz_fitness_categories = get_categories(array('hide_empty' => 0));
foreach ($lz_fitness_categories as $lz_fitness_category) {
	$lz_fitness_cat[$lz_fitness_category->term_id] = $lz_fitness_category->cat_name;
}
/****************************/
// START BLOG SECTION FOR HOME PAGE
/*============BLOG PANEL============*/
$wp_customize->add_section(
	'lz_fitness_blog_section',
	array(
		'title' => __( 'Latest News & Articles Section', 'Luzuk' ),
		'panel' => 'lz_fitness_premium_home_panel',
     	//'priority' => '50',
	)
);
//ENABLE/DISABLE BLOG SECTION
$wp_customize->add_setting(
	'lz_fitness_blog_section_disable',
	array(
		'sanitize_callback' => 'lz_fitness_sanitize_text',
		'default' => 'off'
	)
);
$wp_customize->add_control(
	new lz_fitness_Switch_Control(
		$wp_customize,
		'lz_fitness_blog_section_disable',
		array(
			'settings'      => 'lz_fitness_blog_section_disable',
			'section'       => 'lz_fitness_blog_section',
			'label'         => __( 'Disable Section', 'Luzuk' ),
			'on_off_label'  => array(
				'on' => __( 'Yes', 'Luzuk' ),
				'off' => __( 'No', 'Luzuk' )
			)   
		)
	)
);
backgroundManager($wp_customize, 'blog', 'lz_fitness_blog_section', $color='#fff');

lzCustomLable($wp_customize, 'lz_fitness_sec_blogsectionpadding', 'lz_fitness_blog_section', 'Set Padding For Latest News & Article Section(Complete Section Padding):');

$wp_customize->add_setting(
    'sec_blogsectionTpadding', 
    array(
        'sanitize_callback' => 'lz_fitness_sanitize_text',
        'default'           => __( '9em', 'lz-fitness-premium' )
    )
);
$wp_customize->add_control(
    'sec_blogsectionTpadding',
    array(
        'settings'      => 'sec_blogsectionTpadding',
        'section'       => 'lz_fitness_blog_section',
        'type'          => 'text',
        'label'         => __( 'Latest New & Article Section Top Padding', 'lz-fitness-premium' )
    )
);
$wp_customize->add_setting(
    'sec_blogsectionBpadding',
    array(
        'sanitize_callback' => 'lz_fitness_sanitize_text',
        'default'           => __( '3em', 'lz-fitness-premium' )
    )
);
$wp_customize->add_control(
    'sec_blogsectionBpadding',
    array(
        'settings'      => 'sec_blogsectionBpadding',
        'section'       => 'lz_fitness_blog_section',
        'type'          => 'text',
        'label'         => __( 'Latest New & Article Section Bottom Padding', 'lz-fitness-premium' )
    )
);

$wp_customize->add_setting(
    'sec_blogsectionLpadding',
    array(
        'sanitize_callback' => 'lz_fitness_sanitize_text',
        'default'           => __( '0em', 'lz-fitness-premium' )
    )
);
$wp_customize->add_control(
    'sec_blogsectionLpadding',
    array(
        'settings'      => 'sec_blogsectionLpadding',
        'section'       => 'lz_fitness_blog_section',
        'type'          => 'text',
        'label'         => __( 'Latest New & Article Section Left Padding', 'lz-fitness-premium' )
    )
);
$wp_customize->add_setting(
    'sec_blogsectionRpadding',
    array(
        'sanitize_callback' => 'lz_fitness_sanitize_text',
        'default'           => __( '0em', 'lz-fitness-premium' )
    )
);
$wp_customize->add_control(
    'sec_blogsectionRpadding',
    array(
        'settings'      => 'sec_blogsectionRpadding',
        'section'       => 'lz_fitness_blog_section',
        'type'          => 'text',
        'label'         => __( 'Latest New & Article Section Right Padding', 'lz-fitness-premium' )
    )
);

lzCustomLable($wp_customize, 'lz_fitness_centerimageblossbx', 'lz_fitness_blog_section', 'Background Image Dispaly For Section Title & Sub Title Box:');

// to show & hide another button
$wp_customize->add_setting( 'blogstitlebgimage_display' , array( 'default' => true, 'transport' => 'refresh', ) ); $wp_customize->add_control( 'blogstitlebgimage_display', array( 'label' => 'Background Image Display', 'section' => 'lz_fitness_blog_section', 'settings' => 'blogstitlebgimage_display', 'type' => 'radio', 'choices' => array( 'show' => 'Show Background Image', 'hide' => 'Hide Background Image', ), ) ); 


$wp_customize->add_setting('lz_fitness_premium_Blogseccenterimage_section_lbl', array('sanitize_callback'=>'lz_fitness_sanitize_text'));
$wp_customize->add_control(
    new lz_fitness_Info_Text( 
        $wp_customize,
        'lz_fitness_premium_Blogseccenterimage_section_lbl',
        array(
            'settings'      => 'lz_fitness_premium_Blogseccenterimage_section_lbl',
            'section'       => 'lz_fitness_blog_section',
            'label'         => __( 'Note:', 'InsideTours' ),    
            'description'   => __( '*Required Background Image Of Size 200*180 pixels', 'InsideTours' ),
        )
    )
);
$wp_customize->add_setting(
        'lz_fitness_blogsttl_image_heading',
        array(
            'sanitize_callback' => 'lz_fitness_sanitize_text'
        )
    );
    $wp_customize->add_control(
        new lz_fitness_Customize_Heading(
            $wp_customize,
            'lz_fitness_blogsttl_image_heading',
            array(
                'settings'      => 'lz_fitness_blogsttl_image_heading',
                'section'       => 'lz_fitness_blog_section',
                'label'         => __( 'Set Title & Subtitle Box Background Image & Its Position From Top', 'lz-fitness-premium' ),
            )
        )
    );
    $wp_customize->add_setting(
        'lz_fitness_blogsttl_image',
        array(
            'sanitize_callback' => 'esc_url_raw'
        )
    );
    $wp_customize->add_control(
        new WP_Customize_Image_Control(
            $wp_customize,
            'lz_fitness_blogsttl_image',
            array(
                'section' => 'lz_fitness_blog_section',
                'settings' => 'lz_fitness_blogsttl_image',
                'description' => __('Recommended Image Size: 200X180px', 'lz-fitness-premium')
            )
        )
    );
// end to show & hide button
//lzCustomLable($wp_customize, 'lz_fitness_centerimageservicespositionbx', 'lz_fitness_blog_section', 'Set Background Image Position From Top:');

$wp_customize->add_setting(
    'sec_blogtitleimage',
    array(
        'sanitize_callback' => 'lz_fitness_sanitize_text',
        'default'           => __( '107px', 'lz-fitness-premium' )
    )
);
$wp_customize->add_control(
    'sec_blogtitleimage',
    array(
        'settings'      => 'sec_blogtitleimage',
        'section'       => 'lz_fitness_blog_section',
        'type'          => 'text',
        'label'         => __( 'Set Title & Subtitle Box Background Image Position From Top', 'lz-fitness-premium' )
    )
);


$wp_customize->add_setting(
	'lz_fitness_blog_title_subtitle_heading',
	array(
		'sanitize_callback' => 'lz_fitness_sanitize_text'
	)
);
$wp_customize->add_control(
	new lz_fitness_Customize_Heading(
		$wp_customize,
		'lz_fitness_blog_title_subtitle_heading',
		array(
			'settings'      => 'lz_fitness_blog_title_subtitle_heading',
			'section'       => 'lz_fitness_blog_section',
			'label'         => __( 'Section Title & Sub Title', 'Luzuk' ),
		)
	)
);
$wp_customize->add_setting(
	'lz_fitness_blog_sub_title',
	array(
		'sanitize_callback' => 'lz_fitness_sanitize_text',
		'default'           => __( 'Our Blog & News', 'Luzuk' )
	)
);
$wp_customize->add_control(
	'lz_fitness_blog_sub_title',
	array(
		'settings'      => 'lz_fitness_blog_sub_title',
		'section'       => 'lz_fitness_blog_section',
		'type'          => 'text',
		'label'         => __( 'Add Section Sub Title Here:', 'Luzuk' )
	)
);
addColorPalatOption($wp_customize, 'lz_fitness_blog_sectionSubtColor', 'lz_fitness_blog_section', 'Select Section Sub Title color', '#68a0f9');
addColorPalatOption($wp_customize, 'lz_fitness_blog_sectionSubtbrssColor', 'lz_fitness_blog_section', 'Select Section Sub Title Border color', '#68a0f9');

$wp_customize->add_setting(
	'lz_fitness_blog_title',
	array(
		'sanitize_callback' => 'lz_fitness_sanitize_text',
		'default'           => __( 'Latest New & Articles', 'Luzuk' )
	)
);
$wp_customize->add_control(
	'lz_fitness_blog_title',
	array(
		'settings'      => 'lz_fitness_blog_title',
		'section'       => 'lz_fitness_blog_section',
		'type'          => 'text',
		'label'         => __( 'Add Section Title Here:', 'Luzuk' )
	)
);

addColorPalatOption($wp_customize, 'lz_fitness_blog_sectionttlColor', 'lz_fitness_blog_section', 'Select Section Title color', '#3b3634');


lzCustomLable($wp_customize, 'lz_fitness_sec_blogsectionboxpadding', 'lz_fitness_blog_section', 'Set Padding For Latest News & Article Box:');

$wp_customize->add_setting(
    'sec_blogsectionboxTpadding',
    array(
        'sanitize_callback' => 'lz_fitness_sanitize_text',
        'default'           => __( '0em', 'lz-fitness-premium' )
    )
);
$wp_customize->add_control(
    'sec_blogsectionboxTpadding',
    array(
        'settings'      => 'sec_blogsectionboxTpadding',
        'section'       => 'lz_fitness_blog_section',
        'type'          => 'text',
        'label'         => __( 'Latest New & Article box Top Padding', 'lz-fitness-premium' )
    )
);
$wp_customize->add_setting(
    'sec_blogsectionboxBpadding',
    array(
        'sanitize_callback' => 'lz_fitness_sanitize_text',
        'default'           => __( '0em', 'lz-fitness-premium' )
    )
);
$wp_customize->add_control(
    'sec_blogsectionboxBpadding',
    array(
        'settings'      => 'sec_blogsectionboxBpadding',
        'section'       => 'lz_fitness_blog_section',
        'type'          => 'text',
        'label'         => __( 'Latest New & Article box Bottom Padding', 'lz-fitness-premium' )
    )
);

$wp_customize->add_setting(
    'sec_blogsectionboxLpadding',
    array(
        'sanitize_callback' => 'lz_fitness_sanitize_text',
        'default'           => __( '1em', 'lz-fitness-premium' )
    )
);
$wp_customize->add_control(
    'sec_blogsectionboxLpadding',
    array(
        'settings'      => 'sec_blogsectionboxLpadding',
        'section'       => 'lz_fitness_blog_section',
        'type'          => 'text',
        'label'         => __( 'Latest New & Article box Left Padding', 'lz-fitness-premium' )
    )
);
$wp_customize->add_setting(
    'sec_blogsectionboxRpadding',
    array(
        'sanitize_callback' => 'lz_fitness_sanitize_text',
        'default'           => __( '1em', 'lz-fitness-premium' )
    )
);
$wp_customize->add_control(
    'sec_blogsectionboxRpadding',
    array(
        'settings'      => 'sec_blogsectionboxRpadding',
        'section'       => 'lz_fitness_blog_section',
        'type'          => 'text',
        'label'         => __( 'Latest New & Article box Right Padding', 'lz-fitness-premium' )
    )
);

lzCustomLable($wp_customize, 'lz_fitness_blopostimagesresset', 'lz_fitness_blog_section', 'Note: Set blog posts images of same resolution');
 
// Heading color

//BLOG SETTINGS
$wp_customize->add_setting(
	'lz_fitness_blog_post_count',
	array(
		'default'           => '3',
		'sanitize_callback' => 'lz_fitness_sanitize_choices'
	)
);
$wp_customize->add_control(
	new lz_fitness_Dropdown_Chooser(
		$wp_customize,
		'lz_fitness_blog_post_count',
		array(
			'settings'      => 'lz_fitness_blog_post_count',
			'section'       => 'lz_fitness_blog_section',
			'label'         => __( 'Number of Posts to show', 'Luzuk' ),
			'choices'       => $lz_fitness_post_count_choice
		)
	)
);
$wp_customize->add_setting(
	'lz_fitness_blog_cat_exclude',
	array(
		'sanitize_callback' => 'lz_fitness_sanitize_text'
	)
);
$wp_customize->add_control(
	new lz_fitness_Customize_Checkbox_Multiple(
		$wp_customize,
		'lz_fitness_blog_cat_exclude',
		array(
			'label' => __('Exclude Category from Blog Posts', 'Luzuk'),
			'section' => 'lz_fitness_blog_section',
			'settings' => 'lz_fitness_blog_cat_exclude',
			'choices' => $lz_fitness_cat
		)
	)
);
// END BLOG SECTION FOR HOME PAGE
/****************************/


// CREATING A BLOG SECTION IN CUSTOMIZER FOR BLOG PAGES
$wp_customize->add_section(
	'lz_fitness_premium_blog_section',
	array(
		'title' => __( 'Blog Page Settings', 'Luzuk' ),
        // 'panel' => 'lz_fitness_premium_home_panel'
		'priority' =>19
	)
);

$wp_customize->add_setting('lz_fitness_blog_categories_settings', array('sanitize_callback' => 'lz_fitness_sanitize_text'));
$wp_customize->add_control('lz_fitness_blog_categories_settings', array(
    'settings' => 'lz_fitness_blog_categories_settings',
    'label'    => __('Posts on Blog Page', 'Luzuk'),
    'section'  => 'lz_fitness_premium_blog_section',
    'type'     => 'radio',
    'choices'  => array(
        '0' => __('Excerpts','Luzuk'),
        '1' => __('Full Posts','Luzuk'),
    ),
));
// ADDING THE CATEGORY TO SELECT
$wp_customize->add_setting('lz_fitness_blog_categories', array('sanitize_callback' => 'lz_fitness_sanitize_text'));
$wp_customize->add_control(
	new lz_fitness_Customize_Checkbox_Multiple(
		$wp_customize,
		'lz_fitness_blog_categories',
		array(
			'label' => __('Exclude Category from Blog Posts', 'Luzuk'),
			'section' => 'lz_fitness_premium_blog_section',
			'settings' => 'lz_fitness_blog_categories',
			'choices' => $lz_fitness_cat
		)
	)
);

lzCustomLable($wp_customize, 'homepageblogpostbtnection_button_displaysets', 'lz_fitness_blog_section', 'Button Display & Text Setting:');

// to show & hide another button
$wp_customize->add_setting( 'homepageblogpostbtnection_button_display' , array( 'default' => true, 'transport' => 'refresh', ) ); $wp_customize->add_control( 'homepageblogpostbtnection_button_display', array( 'label' => 'Button Display', 'section' => 'lz_fitness_blog_section', 'settings' => 'homepageblogpostbtnection_button_display', 'type' => 'radio', 'choices' => array( 'show' => 'Show Button', 'hide' => 'Hide Button', ), ) ); 
// end to show & hide button


$wp_customize->add_setting(
    'lz_fitness_homepageblogpostbtnsection_txt',
    array(
        'sanitize_callback' => 'lz_fitness_sanitize_text',
        'default'           => __( 'READ MORE', 'luzuk-premium' )
    )
);
$wp_customize->add_control(
    'lz_fitness_homepageblogpostbtnsection_txt',
    array(
        'settings'      => 'lz_fitness_homepageblogpostbtnsection_txt',
        'section'       => 'lz_fitness_blog_section',
        'type'          => 'text',
        'label'         => __( 'Button Text', 'luzuk-premium' )
    )
);

 


addColorPalatOption($wp_customize, 'lz_fitness_blog_imhhvrbgssColor', 'lz_fitness_blog_section', 'Select Image Hover Overlay Background color', '#ff7c4e');

addColorPalatOption($wp_customize, 'lz_fitness_blog_sectiondateboxbgColor', 'lz_fitness_blog_section', 'Select Date Box Background color', '#ff7c4e');
addColorPalatOption($wp_customize, 'lz_fitness_blog_sectiondateboxtextColor', 'lz_fitness_blog_section', 'Select Date Text color', '#fff');

addColorPalatOption($wp_customize, 'lz_fitness_blog_autndcommColor', 'lz_fitness_blog_section', 'Author & Comment Text color', '#68a0f9');
addColorPalatOption($wp_customize, 'lz_fitness_blog_postttlColor', 'lz_fitness_blog_section', 'Blog Post Title color', '#3b3634');

addColorPalatOption($wp_customize, 'lz_fitness_blog_postttlhvrssColor', 'lz_fitness_blog_section', 'Blog Post Title Hover color', '#da6942');

addColorPalatOption($wp_customize, 'lz_fitness_blog_postdescColor', 'lz_fitness_blog_section', 'Blog Post Description color', '#615d5c');


addColorPalatOption($wp_customize, 'lz_fitness_blog_btntextcColor', 'lz_fitness_blog_section', 'Button Text color', '#ff7c4e');
addColorPalatOption($wp_customize, 'lz_fitness_blog_btntexthvrcColor', 'lz_fitness_blog_section', 'Button Text Hover color', '#ffffff');

addColorPalatOption($wp_customize, 'lz_fitness_blog_btnbackgroundcColor', 'lz_fitness_blog_section', 'Button Background color', '#f2f1f0');
addColorPalatOption($wp_customize, 'lz_fitness_blog_btnbackgroundhvrccColor', 'lz_fitness_blog_section', 'Button Background Hover color', '#ff7c4e');

