<?php
/**
 * Theme Customizer Controls
 *
 * @package somalite
 */


if ( ! function_exists( 'somalite_customizer_blog_register' ) ) :
function somalite_customizer_blog_register( $wp_customize ) {
     
    //Blog Settings
    $wp_customize->add_section(
        'soma_blog_settings',
        array (
            'priority'      => 25,
            'capability'    => 'edit_theme_options',
            'theme_supports'=> '',
            'title'         => esc_html__( 'Blog Settings', 'somalite' )
        )
    );

    // Title label
    $wp_customize->add_setting( 
        'somalite_label_blog_settings', 
        array(
              'sanitize_callback' => 'somalite_sanitize_title',
        ) 
    );

    $wp_customize->add_control( 
        new Somalite_Title_Info_Control( $wp_customize, 'somalite_label_blog_settings', 
        array(
            'label'       => esc_html__( 'Blog Settings', 'somalite' ),
            'section'     => 'soma_blog_settings',
            'type'        => 'somalite-title',
            'settings'    => 'somalite_label_blog_settings',
        ) 
    ));

    // Blog styles
    $wp_customize->add_setting(
        'sm_blog_style',
        array(
            'type' => 'theme_mod',
            'default'           => 'style2',
            'sanitize_callback' => 'somalite_sanitize_select'
        )
    );

    $wp_customize->add_control(
        'sm_blog_style',
        array(
            'settings'      => 'sm_blog_style',
            'section'       => 'soma_blog_settings',
            'type'          => 'radio',
            'label'         => esc_html__( 'Select Blog Style:', 'somalite' ),
            'description'   => '',
            'choices' => array(
                            'style1' => esc_html__('1 Column BLog Style', 'somalite'),
                            'style2' => esc_html__('2 Columns Blog Style', 'somalite'),
                            ),
        )
    );
    
}
endif;

add_action( 'customize_register', 'somalite_customizer_blog_register' );