<?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' => __( 'Blog Section', 'lz-fitness-premium' ),
		'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', 'lz-fitness-premium' ),
			'on_off_label'  => array(
				'on' => __( 'Yes', 'lz-fitness-premium' ),
				'off' => __( 'No', 'lz-fitness-premium' )
			)   
		)
	)
);

backgroundManager($wp_customize, 'blog', 'lz_fitness_blog_section', $color='#fff');


lzCustomLable($wp_customize, 'lz_fitness_blog_seccurvedisplay', 'lz_fitness_blog_section', 'Blog Wave Curve Display Setting:');
// to show & hide another button
$wp_customize->add_setting( 'cds_blog_curvedisplay' , array( 'default' => true, 'transport' => 'refresh', ) ); $wp_customize->add_control( 'cds_blog_curvedisplay', array( 'label' => 'Blog Wave Curve Display', 'section' => 'lz_fitness_blog_section', 'settings' => 'cds_blog_curvedisplay', 'type' => 'radio', 'choices' => array( 'show' => 'Show Wave Curve', 'hide' => 'Hide Wave Curve', ), ) ); 
// end to show & hide button

 // Curve color
    addColorPalatOption($wp_customize, 'lz_fitness_blog_curveColor', 'lz_fitness_blog_section', 'wave curve color', '#fff');

$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', 'lz-fitness-premium' ),
		)
	)
);
$wp_customize->add_setting(
	'lz_fitness_blog_title',
	array(
		'sanitize_callback' => 'lz_fitness_sanitize_text',
		'default'           => __( 'Latest Post', 'lz-fitness-premium' )
	)
);
$wp_customize->add_control(
	'lz_fitness_blog_title',
	array(
		'settings'      => 'lz_fitness_blog_title',
		'section'       => 'lz_fitness_blog_section',
		'type'          => 'text',
		'label'         => __( 'Title', 'lz-fitness-premium' )
	)
);


// Heading color
addColorPalatOption($wp_customize, 'lz_fitness_blog_HeadingColor', 'lz_fitness_blog_section', 'Heading color', '#303030');

       // Heading border color
addColorPalatOption($wp_customize, 'lz_fitness_blog_HeadingborderColor', 'lz_fitness_blog_section', 'Section Heading border color', '#01beff');
// Heading border icon color
addColorPalatOption($wp_customize, 'lz_fitness_blog_HeadingbordericonColor', 'lz_fitness_blog_section', 'Section Heading border icon color', '#ff6796');

lzCustomLable($wp_customize, 'lz_fitness_blog_lblteamcurvedisplay', 'lz_fitness_blog_section', 'Blog Box Wave Curve Display Setting:');
// to show & hide another button
$wp_customize->add_setting( 'cds_singleblog_curvedisplay' , array( 'default' => true, 'transport' => 'refresh', ) ); $wp_customize->add_control( 'cds_singleblog_curvedisplay', array( 'label' => 'Blog Box Wave Curve Display', 'section' => 'lz_fitness_blog_section', 'settings' => 'cds_singleblog_curvedisplay', 'type' => 'radio', 'choices' => array( 'show' => 'Show Wave Curve', 'hide' => 'Hide Wave Curve', ), ) ); 
// end to show & hide button

 // Curve color
    addColorPalatOption($wp_customize, 'lz_fitness_blog_boxcurveColor', 'lz_fitness_blog_section', 'Blog box wave curve color', '#fff');


// Box  color
addColorPalatOption($wp_customize, 'lz_fitness_blog_boxColor', 'lz_fitness_blog_section', 'Blog box color', '#fff');

// date  color
addColorPalatOption($wp_customize, 'lz_fitness_blog_dateColor', 'lz_fitness_blog_section', 'Date color', '#ff6796');

// border color
addColorPalatOption($wp_customize, 'lz_fitness_blog_borderColor', 'lz_fitness_blog_section', 'Border color', '#01beff');

// Title color
addColorPalatOption($wp_customize, 'lz_fitness_blog_TitleColor', 'lz_fitness_blog_section', 'Title color', '#444444');

// Title hover color
addColorPalatOption($wp_customize, 'lz_fitness_blog_TitlehoverColor', 'lz_fitness_blog_section', 'Title hover color', '#01beff');

// Text color
addColorPalatOption($wp_customize, 'lz_fitness_blog_TextColor', 'lz_fitness_blog_section', 'Text color', '#2f2f2f');

// button text color
addColorPalatOption($wp_customize, 'lz_fitness_blog_btntextColor', 'lz_fitness_blog_section', 'Button text color', '#fff');

// button bg color
addColorPalatOption($wp_customize, 'lz_fitness_blog_btnbgColor', 'lz_fitness_blog_section', 'Button background color', '#01beff');

// button text hover color
addColorPalatOption($wp_customize, 'lz_fitness_blog_btntexthoverColor', 'lz_fitness_blog_section', 'Button text hover color', '#fff');

// button bg hover color
addColorPalatOption($wp_customize, 'lz_fitness_blog_btnbghoverColor', 'lz_fitness_blog_section', 'Button background hover color', '#ff6796');

//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', 'lz-fitness-premium' ),
			'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', 'lz-fitness-premium'),
			'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', 'lz-fitness-premium' ),
        // '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', 'lz-fitness-premium'),
    'section'  => 'lz_fitness_premium_blog_section',
    'type'     => 'radio',
    'choices'  => array(
        '0' => __('Excerpts','lz-fitness-premium'),
        '1' => __('Full Posts','lz-fitness-premium'),
    ),
));
// 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', 'lz-fitness-premium'),
			'section' => 'lz_fitness_premium_blog_section',
			'settings' => 'lz_fitness_blog_categories',
			'choices' => $lz_fitness_cat
		)
	)
);



