<?php   
$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;
}

$wp_customize->add_section(
	'treandingblog_section',
	array(
		'title' => __( 'Trending Posts Section', 'Luzuk' ),
		'panel' => 'lz_fitness_premium_home_panel',
     	//'priority' => '50',
	)
);
$wp_customize->add_setting(
	'treandingblog_section_disable',
	array(
		'sanitize_callback' => 'lz_fitness_sanitize_text',
		'default' => 'off'
	)
);
$wp_customize->add_control(
	new lz_fitness_Switch_Control(
		$wp_customize,
		'treandingblog_section_disable',
		array(
			'settings'      => 'treandingblog_section_disable',
			'section'       => 'treandingblog_section',
			'label'         => __( 'Disable Section', 'Luzuk' ),
			'on_off_label'  => array(
				'on' => __( 'Yes', 'Luzuk' ),
				'off' => __( 'No', 'Luzuk' )
			)   
		)
	)
);
backgroundManager($wp_customize, 'treandingpost', 'treandingblog_section', $color='#ffffff');
 


lzCustomLable($wp_customize, 'sec_treandingblogsection_padding', 'treandingblog_section', 'Set Padding For Section:');

$wp_customize->add_setting(
    'sec_treandingblogsectionTpadding', 
    array(
        'sanitize_callback' => 'lz_fitness_sanitize_text',
        'default'           => __( '1em', 'Luzuk' )
    )
);
$wp_customize->add_control(
    'sec_treandingblogsectionTpadding',
    array(
        'settings'      => 'sec_treandingblogsectionTpadding',
        'section'       => 'treandingblog_section',
        'type'          => 'text',
        'label'         => __( 'Section Top Padding', 'Luzuk' )
    )
);
$wp_customize->add_setting(
    'sec_treandingblogsectionBpadding',
    array(
        'sanitize_callback' => 'lz_fitness_sanitize_text',
        'default'           => __( '2em', 'Luzuk' )
    )
);
$wp_customize->add_control(
    'sec_treandingblogsectionBpadding',
    array(
        'settings'      => 'sec_treandingblogsectionBpadding',
        'section'       => 'treandingblog_section',
        'type'          => 'text',
        'label'         => __( 'Section Bottom Padding', 'Luzuk' )
    )
);

$wp_customize->add_setting(
    'sec_treandingblogsectionLpadding',
    array(
        'sanitize_callback' => 'lz_fitness_sanitize_text',
        'default'           => __( '0em', 'Luzuk' )
    )
);
$wp_customize->add_control(
    'sec_treandingblogsectionLpadding',
    array(
        'settings'      => 'sec_treandingblogsectionLpadding',
        'section'       => 'treandingblog_section',
        'type'          => 'text',
        'label'         => __( 'Section Left Padding', 'Luzuk' )
    )
);
$wp_customize->add_setting(
    'sec_treandingblogsectionRpadding',
    array(
        'sanitize_callback' => 'lz_fitness_sanitize_text',
        'default'           => __( '0em', 'Luzuk' )
    )
);
$wp_customize->add_control(
    'sec_treandingblogsectionRpadding',
    array(
        'settings'      => 'sec_treandingblogsectionRpadding',
        'section'       => 'treandingblog_section',
        'type'          => 'text',
        'label'         => __( 'Section Right Padding', 'Luzuk' )
    )
);


$wp_customize->add_setting(
	'treanding_title_heading',
	array(
		'sanitize_callback' => 'lz_fitness_sanitize_text'
	)
);
$wp_customize->add_control(
	new lz_fitness_Customize_Heading(
		$wp_customize,
		'treanding_title_heading',
		array(
			'settings'      => 'treanding_title_heading',
			'section'       => 'treandingblog_section',
			'label'         => __( 'Section Title', 'Luzuk' ),
		)
	)
);
$wp_customize->add_setting(
	'treanding_title',
	array(
		'sanitize_callback' => 'lz_fitness_sanitize_text',
		'default'           => __( 'Trending Posts', 'Luzuk' )
	)
);
$wp_customize->add_control(
	'treanding_title',
	array(
		'settings'      => 'treanding_title',
		'section'       => 'treandingblog_section',
		'type'          => 'text',
		'label'         => __( 'Add Section Title Here:', 'Luzuk' )
	)
);

addColorPalatOption($wp_customize, 'treandingBlog_SectionTitleColor', 'treandingblog_section', 'Section Title color', '#2b2b2b');
addColorPalatOption($wp_customize, 'treandingBlog_SectionTitleBorderColor', 'treandingblog_section', 'Section Title Border color', '#7d52fc');


lzCustomLable($wp_customize, 'treanding_blopostimagesresset', 'treandingblog_section', 'Note: Set posts images of same resolution');
 
 
$wp_customize->add_setting(
	'luzuk_treandingblog_post_count',
	array(
		'default'           => '12',
		'sanitize_callback' => 'lz_fitness_sanitize_choices'
	)
);
$wp_customize->add_control(
	new lz_fitness_Dropdown_Chooser(
		$wp_customize,
		'luzuk_treandingblog_post_count',
		array(
			'settings'      => 'luzuk_treandingblog_post_count',
			'section'       => 'treandingblog_section',
			'label'         => __( 'Number of  treanding Posts to Show', 'Luzuk' ),
			'choices'       => $lz_fitness_post_count_choice
		)
	)
);
$wp_customize->add_setting(
	'luzuk_treandingblog_cat_exclude',
	array(
		'sanitize_callback' => 'lz_fitness_sanitize_text'
	)
);
$wp_customize->add_control(
	new lz_fitness_Customize_Checkbox_Multiple(
		$wp_customize,
		'luzuk_treandingblog_cat_exclude',
		array(
			'label' => __('Exclude Category from Blog Posts', 'Luzuk'),
			'section' => 'treandingblog_section',
			'settings' => 'luzuk_treandingblog_cat_exclude',
			'choices' => $lz_fitness_cat
		)
	)
);

// 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, 'sec_treandingblogsection_opacity', 'treandingblog_section', 'Set Posts Image Hover Overlay Opacity & Its Background Color:');

$wp_customize->add_setting(
    'sec_treandingblogsectionOpacity', 
    array(
        'sanitize_callback' => 'lz_fitness_sanitize_text',
        'default'           => __( '0.4', 'Luzuk' )
    )
);
$wp_customize->add_control(
    'sec_treandingblogsectionOpacity',
    array(
        'settings'      => 'sec_treandingblogsectionOpacity',
        'section'       => 'treandingblog_section',
        'type'          => 'text',
        'label'         => __( 'Opacity', 'Luzuk' )
    )
);
addColorPalatOption($wp_customize, 'treandingBlog_ImgHvrOverBgsColor', 'treandingblog_section', 'Posts Hover Overlay Background color', '#000000');

lzCustomLable($wp_customize, 'sec_treandingblogsection_OtherC', 'treandingblog_section', 'Other Colors:');


addColorPalatOption($wp_customize, 'treandingBlog_TitleColor', 'treandingblog_section', 'Posts Title color', '#222222');
addColorPalatOption($wp_customize, 'treandingBlog_TitleHvrColor', 'treandingblog_section', 'Posts Title Hover color', '#7d51fc');
addColorPalatOption($wp_customize, 'treandingBlog_CatTextColor', 'treandingblog_section', 'Posts Category Text color', '#ffffff');
addColorPalatOption($wp_customize, 'treandingBlog_Cat1BgColor', 'treandingblog_section', 'Category Text Background color 1', '#dc3d66');
addColorPalatOption($wp_customize, 'treandingBlog_Cat2BgColor', 'treandingblog_section', 'Category Text Background color 2', '#7d51fc');
addColorPalatOption($wp_customize, 'treandingBlog_Cat3BgColor', 'treandingblog_section', 'Category Text Background color 3', '#f8b739');
addColorPalatOption($wp_customize, 'treandingBlog_Cat4BgColor', 'treandingblog_section', 'Category Text Background color 4', '#296170');
addColorPalatOption($wp_customize, 'treandingBlog_ContentColor', 'treandingblog_section', 'Content color', '#646464');

addColorPalatOption($wp_customize, 'treandingBlog_DateIconTxtColor', 'treandingblog_section', 'Date Icon & Text color', '#9b9b9b');

addColorPalatOption($wp_customize, 'treandingBlog_PrevNxtBtnColor', 'treandingblog_section', 'Prev & Next Button color', '#ababab');
addColorPalatOption($wp_customize, 'treandingBlog_PrevNxtBtnHvrsColor', 'treandingblog_section', 'Prev & Next Button Hover color', '#ffffff');

addColorPalatOption($wp_customize, 'treandingBlog_PrevNxtBtnBgssColor', 'treandingblog_section', 'Prev & Next Button Background color', '#f7f7f7');
addColorPalatOption($wp_customize, 'treandingBlog_PrevNxtBtnBgssHvrsColor', 'treandingblog_section', 'Prev & Next Button Hover Background color', '#7d51fc');
 