<?php   
/**
 * Createing a bog pannel for customizer
 *
 *
 */
$luzuk_them_categories = get_categories(array('hide_empty' => 0));
foreach ($luzuk_them_categories as $luzuk_them_category) {
	$luzuk_them_cat[$luzuk_them_category->term_id] = $luzuk_them_category->cat_name;
}
/****************************/
// START BLOG SECTION FOR HOME PAGE
/*============BLOG PANEL============*/
$wp_customize->add_section(
	'luzuk_them_blog_section',
	array(
		'title' => __( 'Our Blog Section', 'Luzuk' ),
		'panel' => 'luzuk_them_premium_home_panel',
     	//'priority' => '50',
	)
);
//ENABLE/DISABLE BLOG SECTION
$wp_customize->add_setting(
	'luzuk_them_blog_section_disable',
	array(
		'sanitize_callback' => 'luzuk_them_sanitize_text',
		'default' => 'off'
	)
);

$wp_customize->add_control(
	new luzuk_them_Switch_Control(
		$wp_customize,
		'luzuk_them_blog_section_disable',
		array(
			'settings'      => 'luzuk_them_blog_section_disable',
			'section'       => 'luzuk_them_blog_section',
			'label'         => __( 'Disable Section', 'Luzuk' ),
			'on_off_label'  => array(
				'on' => __( 'Yes', 'Luzuk' ),
				'off' => __( 'No', 'Luzuk' )
			)   
		)
	)
);
backgroundManager($wp_customize, 'blog', 'luzuk_them_blog_section', $color='#f3f3f3');

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

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

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





$wp_customize->add_setting(
	'luzuk_them_blog_title_subtitle_heading',
	array(
		'sanitize_callback' => 'luzuk_them_sanitize_text'
	)
);
$wp_customize->add_control(
	new luzuk_them_Customize_Heading(
		$wp_customize,
		'luzuk_them_blog_title_subtitle_heading',
		array(
			'settings'      => 'luzuk_them_blog_title_subtitle_heading',
			'section'       => 'luzuk_them_blog_section',
			'label'         => __( 'Section Title ', 'Luzuk' ),
		)
	)
);



$wp_customize->add_setting(
	'luzuk_them_blog_title',
	array(
		'sanitize_callback' => 'luzuk_them_sanitize_text',
		'default'           => __( 'Our Blog', 'Luzuk' )
	)
);
$wp_customize->add_control(
	'luzuk_them_blog_title',
	array(
		'settings'      => 'luzuk_them_blog_title',
		'section'       => 'luzuk_them_blog_section',
		'type'          => 'text',
		'label'         => __( 'Add Section Title Here:', 'Luzuk' )
	)
);

addColorPalatOption($wp_customize, 'luzuk_them_blog_sectionttlColor', 'luzuk_them_blog_section', 'Select Section Title color', '#101010');

addColorPalatOption($wp_customize, 'blog_sectionttlborderColor', 'luzuk_them_blog_section', 'Select Section Title Border color', '#fb6f58');




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

//BLOG SETTINGS
$wp_customize->add_setting(
	'luzuk_them_blog_post_count',
	array(
		'default'           => '3',
		'sanitize_callback' => 'luzuk_them_sanitize_choices'
	)
);
$wp_customize->add_control(
	new luzuk_them_Dropdown_Chooser(
		$wp_customize,
		'luzuk_them_blog_post_count',
		array(
			'settings'      => 'luzuk_them_blog_post_count',
			'section'       => 'luzuk_them_blog_section',
			'label'         => __( 'Number of Posts to show', 'Luzuk' ),
			'choices'       => $luzuk_them_post_count_choice
		)
	)
);
$wp_customize->add_setting(
	'luzuk_them_blog_cat_exclude',
	array(
		'sanitize_callback' => 'luzuk_them_sanitize_text'
	)
);
$wp_customize->add_control(
	new luzuk_them_Customize_Checkbox_Multiple(
		$wp_customize,
		'luzuk_them_blog_cat_exclude',
		array(
			'label' => __('Exclude Category from Blog Posts', 'Luzuk'),
			'section' => 'luzuk_them_blog_section',
			'settings' => 'luzuk_them_blog_cat_exclude',
			'choices' => $luzuk_them_cat
		)
	)
);
// END BLOG SECTION FOR HOME PAGE
/****************************/


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

$wp_customize->add_setting('luzuk_them_blog_categories_settings', array('sanitize_callback' => 'luzuk_them_sanitize_text'));
$wp_customize->add_control('luzuk_them_blog_categories_settings', array(
    'settings' => 'luzuk_them_blog_categories_settings',
    'label'    => __('Posts on Blog Page', 'Luzuk'),
    'section'  => 'luzuk_them_premium_blog_section',
    'type'     => 'radio',
    'choices'  => array(
        '0' => __('Excerpts','Luzuk'),
        '1' => __('Full Posts','Luzuk'),
    ),
));
// ADDING THE CATEGORY TO SELECT
$wp_customize->add_setting('luzuk_them_blog_categories', array('sanitize_callback' => 'luzuk_them_sanitize_text'));
$wp_customize->add_control(
	new luzuk_them_Customize_Checkbox_Multiple(
		$wp_customize,
		'luzuk_them_blog_categories',
		array(
			'label' => __('Exclude Category from Blog Posts', 'Luzuk'),
			'section' => 'luzuk_them_premium_blog_section',
			'settings' => 'luzuk_them_blog_categories',
			'choices' => $luzuk_them_cat
		)
	)
);

lzCustomLable($wp_customize, 'homepageblogpostbtnection_button_displaysets', 'luzuk_them_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' => 'luzuk_them_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(
    'luzuk_them_homepageblogpostbtnsection_txt',
    array(
        'sanitize_callback' => 'luzuk_them_sanitize_text',
        'default'           => __( 'READ MORE', 'luzuk-premium' )
    )
);
$wp_customize->add_control(
    'luzuk_them_homepageblogpostbtnsection_txt',
    array(
        'settings'      => 'luzuk_them_homepageblogpostbtnsection_txt',
        'section'       => 'luzuk_them_blog_section',
        'type'          => 'text',
        'label'         => __( 'Button Text', 'luzuk-premium' )
    )
);

 


addColorPalatOption($wp_customize, 'luzuk_them_blog_imhhvrbgssColor', 'luzuk_them_blog_section', 'Select Image Hover Overlay Background color', '#241c22');

addColorPalatOption($wp_customize, 'luzuk_them_blog_sectiondateboxbgColor', 'luzuk_them_blog_section', 'Select Date Box Background color', '#f76953');

addColorPalatOption($wp_customize, 'blog_sectiondateboxHighlightsbgColor', 'luzuk_them_blog_section', 'Select Date Highlights Box Background color', '#363636');

addColorPalatOption($wp_customize, 'luzuk_them_blog_sectiondateboxtextColor', 'luzuk_them_blog_section', 'Select Date Text color', '#fff');


addColorPalatOption($wp_customize, 'luzuk_them_blog_postttlColor', 'luzuk_them_blog_section', 'Blog Post Title color', '#ffffff');

addColorPalatOption($wp_customize, 'luzuk_them_blog_postttlhvrssColor', 'luzuk_them_blog_section', 'Blog Post Title Hover color', '#f76953');

addColorPalatOption($wp_customize, 'luzuk_them_blog_postdescColor', 'luzuk_them_blog_section', 'Blog Post Description Text color', '#ffffff');


addColorPalatOption($wp_customize, 'luzuk_them_blog_btntextcColor', 'luzuk_them_blog_section', 'Button Text color', '#f96855');

addColorPalatOption($wp_customize, 'luzuk_them_blog_btntexthvrcColor', 'luzuk_them_blog_section', 'Button Text Hover color', '#ffffff');



