<?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', '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='#f5f5f5');
// to show & hide another button
$wp_customize->add_setting( 'blogsectionsjape_button_display' , array( 'default' => true, 'transport' => 'refresh', ) ); $wp_customize->add_control( 'blogsectionsjape_button_display', array( 'label' => 'Tringle shape Display', 'section' => 'lz_fitness_blog_section', 'settings' => 'blogsectionsjape_button_display', 'type' => 'radio', 'choices' => array( 'show' => 'Show Tringle shape', 'hide' => 'Hide Tringle shape', ), ) ); 


// to show & hide another button
$wp_customize->add_setting( 'blogmainsecanimation_button_display' , array( 'default' => true, 'transport' => 'refresh', ) ); $wp_customize->add_control( 'blogmainsecanimation_button_display', array( 'label' => 'Animation Display Setting', 'section' => 'lz_fitness_blog_section', 'settings' => 'blogmainsecanimation_button_display', 'type' => 'radio', 'choices' => array( 'show' => 'Start animation', 'hide' => 'Stop Animation', ), ) ); 
// end to show & hide button

addColorPalatOption($wp_customize, 'lz_fitness_blogsec_animationboxColor', 'lz_fitness_blog_section', 'Select animated box color','#e7ccf7');



// end to show & hide button
$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_title',
	array(
		'sanitize_callback' => 'lz_fitness_sanitize_text',
		'default'           => __( 'Blog Section', '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', '#313131');

$wp_customize->add_setting(
	'lz_fitness_blog_sub_title',
	array(
		'sanitize_callback' => 'lz_fitness_sanitize_text',
		'default'           => __( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus eu pharetra ex. Etiam eget diam ligula. Sed at blandit ante.', 'Luzuk' )
	)
);
$wp_customize->add_control(
	'lz_fitness_blog_sub_title',
	array(
		'settings'      => 'lz_fitness_blog_sub_title',
		'section'       => 'lz_fitness_blog_section',
		'type'          => 'textarea',
		'label'         => __( 'Add Section Sub Title Here:', 'Luzuk' )
	)
);

// Heading color
addColorPalatOption($wp_customize, 'lz_fitness_blog_sectionSubtColor', 'lz_fitness_blog_section', 'Select Section Sub Title color', '#6c6c6c');

//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
		)
	)
);


// for gradiant

$wp_customize->add_setting(
    'lz_fitness_premium_blog_bg_color_one', array(
        'default'           => '#4737a4',
        'sanitize_callback' => 'sanitize_hex_color',
    )
);
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize,'lz_fitness_premium_blog_bg_color_one',array(
            'settings'      => 'lz_fitness_premium_blog_bg_color_one',
            'section'       => 'lz_fitness_blog_section',
            'label'         => __( 'Post Image Overlay Hover Background Gradient Color One ', 'Luzuk Premium' ),
        )
    )
);

$wp_customize->add_setting(
    'lz_fitness_premium_blog_bg_color_two', array(
        'default'           => '#c265f1',
        'sanitize_callback' => 'sanitize_hex_color',
    )
);
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize,'lz_fitness_premium_blog_bg_color_two',array(
            'settings'      => 'lz_fitness_premium_blog_bg_color_two',
            'section'       => 'lz_fitness_blog_section',
            'label'         => __( 'Post Image Overlay Hover Background Gradient Color Two ', 'Luzuk Premium' ),
        )
    )
); 



addColorPalatOption($wp_customize, 'lz_fitness_blog_blgpostimgovericoncColor', 'lz_fitness_blog_section', 'Select post Image hover Icon color', '#6643c4');
addColorPalatOption($wp_customize, 'lz_fitness_blog_blgpostimgovericonbgsscColor', 'lz_fitness_blog_section', 'Select post Image hover Icon Background color', '#fff');


addColorPalatOption($wp_customize, 'lz_fitness_blog_blgpostDatetxthvrColor', 'lz_fitness_blog_section', 'Select Date & Comment Icon color', '#6d6c6c');
addColorPalatOption($wp_customize, 'lz_fitness_blog_blgpostDatetxtColor', 'lz_fitness_blog_section', 'Select Post Date & Comment Text color', '#6d6c6c');

addColorPalatOption($wp_customize, 'lz_fitness_blog_blgpostTitleColor', 'lz_fitness_blog_section', 'Select Post Title color', '#252525');
addColorPalatOption($wp_customize, 'lz_fitness_blog_blgpostTitlehvrColor', 'lz_fitness_blog_section', 'Select Post Title Hover color', '#6943c4');
addColorPalatOption($wp_customize, 'lz_fitness_blog_blgpostcontentColor', 'lz_fitness_blog_section', 'Select Post Text color', '#8a8a8a');
addColorPalatOption($wp_customize, 'lz_fitness_blog_blgpostcontenthoverclColor', 'lz_fitness_blog_section', 'Select Post Text Hover color', '#121212');

addColorPalatOption($wp_customize, 'lz_fitness_blog_blgposthvrhghtbgssColor', 'lz_fitness_blog_section', 'Select Post Box background color', '#fff');

addColorPalatOption($wp_customize, 'lz_fitness_blog_hvrhghtbrssColor', 'lz_fitness_blog_section', 'Select Post Box hover highlight border color', '#6943c4');




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

$wp_customize->add_setting(
    'lz_fitness_homepageblogbtnsection_txt',
    array(
        'sanitize_callback' => 'lz_fitness_sanitize_text',
        'default'           => __( 'View More' )
    )
);
$wp_customize->add_control(
    'lz_fitness_homepageblogbtnsection_txt',
    array(
        'settings'      => 'lz_fitness_homepageblogbtnsection_txt',
        'section'       => 'lz_fitness_blog_section',
        'type'          => 'text',
        'label'         => __( 'Add Button Text Here:', 'luzuk' )
    )
);
$wp_customize->add_setting('lz_fitness_homepageblogbtnectionlink',   array('default'=> 'add Button link here', 'sanitize_callback' => 'esc_url_raw'));
$wp_customize->add_control('lz_fitness_homepageblogbtnectionlink',
    array(
        'settings'      => 'lz_fitness_homepageblogbtnectionlink',
        'section'       => 'lz_fitness_blog_section',
        'type'          => 'url',
        'label'         => __( 'Add Button Url Here:', 'Hexagon' )
    )
);


addColorPalatOption($wp_customize, 'lz_fitness_blog_btntextColor', 'lz_fitness_blog_section', 'Select Button Text color', '#6943c4');
addColorPalatOption($wp_customize, 'lz_fitness_blog_btntexthvrColor', 'lz_fitness_blog_section', 'Select Button Text Hover color', '#fff');

addColorPalatOption($wp_customize, 'lz_fitness_blog_btnbgssColor', 'lz_fitness_blog_section', 'Select Button Background color', '#fff');
addColorPalatOption($wp_customize, 'lz_fitness_blog_btnbgsshvrColor', 'lz_fitness_blog_section', 'Select Button Background Hover color', '#6943c4');

addColorPalatOption($wp_customize, 'lz_fitness_blog_btnbrssColor', 'lz_fitness_blog_section', 'Select Button border color', '#6943c4');
addColorPalatOption($wp_customize, 'lz_fitness_blog_btnbrsshvrColor', 'lz_fitness_blog_section', 'Select Button border hover color', '#6943c4');

addColorPalatOption($wp_customize, 'lz_fitness_blog_btnhghtbrsshvrColor', 'lz_fitness_blog_section', 'Select Button hover highlight border color', '#fff');


