<?php
/**
 * Adds Layout Options section and sidebar position setting.
 *
 * @param WP_Customize_Manager $wp_customize The Customizer object.
 */

// Add layout options section.
$wp_customize->add_section( 'vastnews_layout_options', array(
    'title'    => esc_html__( 'Layout Options', 'vastnews' ),
    'priority' => 100,
    'panel'=>'vastnews_theme_options',
) );


// Add sidebar 
$wp_customize->add_setting( 'vastnews_blog_sidebar_position', array(
    'default'           => 'no-sidebar',
    'sanitize_callback' => 'vastnews_sanitize_select',
    'type'              => 'theme_mod',
    'transport'         => 'refresh',


) );

$wp_customize->add_control('vastnews_blog_sidebar_position',array(
    'label'   => esc_html__( 'Sidebar Position', 'vastnews'),
    'section' => 'vastnews_layout_options',
    'type'    => 'select',
    'capability'        => 'edit_theme_options',
    'choices' => array(
        'right-sidebar' => esc_html__( 'Right Sidebar', 'vastnews'),
        'no-sidebar'    => esc_html__( 'No Sidebar', 'vastnews'),
        'left-sidebar'   => esc_html__( 'Left Sidebar', 'vastnews' ),
    ),
));

// Post Sidebar Position

$wp_customize->add_setting(
    'vastnews_post_sidebar_position',
        array (
             'default'           => 'right-sidebar',
             'sanitize_callback' => 'vastnews_sanitize_select',
             'type'              => 'theme_mod',				 
             'transport'         => 'refresh',
        )
);

$wp_customize->add_control('vastnews_post_sidebar_position',array(
    'label'   => esc_html__( 'Post Sidebar Position', 'vastnews' ),
    'section' => 'vastnews_layout_options',
    'type'    => 'select',
    'capability'        => 'edit_theme_options',
    'choices' => array(
        'right-sidebar' => esc_html__( 'Right Sidebar', 'vastnews' ),
        'no-sidebar'    => esc_html__( 'No Sidebar', 'vastnews' ),
        'left-sidebar' => esc_html__( 'Left Sidebar', 'vastnews' ),
        
    ),
));

//  Page Sidebar Position.
$wp_customize->add_setting('vastnews_page_sidebar_position',
array(
    'default'           => 'right-sidebar',
    'sanitize_callback' => 'vastnews_sanitize_select',
    'type'              => 'theme_mod',		
    'transport'         => 'refresh',
    
));

$wp_customize->add_control('vastnews_page_sidebar_position',array(
    'label'   => esc_html__( 'Page Sidebar Position', 'vastnews' ),
    'section' => 'vastnews_layout_options',
    'type'    => 'select',
    'capability'        => 'edit_theme_options',
    'choices' => array(
        'right-sidebar'=> esc_html__( 'Right Sidebar', 'vastnews' ),
        'no-sidebar'   => esc_html__( 'No Sidebar', 'vastnews' ),
        'left-sidebar' => esc_html__( 'Left Sidebar', 'vastnews' ),
        
    ),
));


//  archive Sidebar Position.
$wp_customize->add_setting( 'vastnews_archive_sidebar_position', array(
    'default'           => 'right-sidebar',
    'sanitize_callback' => 'vastnews_sanitize_select',
    'type'              => 'theme_mod',	
    'transport'         => 'refresh',
) );

$wp_customize->add_control('vastnews_archive_sidebar_position',array(
    'label'   => esc_html__( 'Archive Sidebar Position', 'vastnews'),
    'section' => 'vastnews_layout_options',
    'type'    => 'select',
    'capability'        => 'edit_theme_options',
    'choices' => array(
        'right-sidebar' => esc_html__( 'Right Sidebar', 'vastnews'),
        'no-sidebar'    => esc_html__( 'No Sidebar', 'vastnews'),
        'left-sidebar'   => esc_html__( 'Left Sidebar', 'vastnews' ),
       
    ),
));