add_section( 'bigbang_general', array( 'title' => esc_html__( 'General Settings', 'bigbang' ), 'panel' => 'bigbang_appearance_settings', 'priority' => 25, ) ); if ( class_exists( 'bigbang_Customize_Control_Radio_Image' ) ) { $sidebar_choices = array( 'full-width' => array( 'url' => 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAABqAQMAAABknzrDAAAABlBMVEX////V1dXUdjOkAAAAPUlEQVRIx2NgGAUkAcb////Y/+d/+P8AdcQoc8vhH/X/5P+j2kG+GA3CCgrwi43aMWrHqB2jdowEO4YpAACyKSE0IzIuBgAAAABJRU5ErkJggg==', 'label' => esc_html__( 'Full Width', 'bigbang' ), ), 'sidebar-left' => array( 'url' => apply_filters( 'bigbang_layout_control_image_left', 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAABqAgMAAAAjP0ATAAAACVBMVEX///8+yP/V1dXG9YqxAAAAWElEQVR42mNgGAXDE4RCQMDAKONaBQINWqtWrWBatQDIaxg8ygYqQIAOYwC6bwHUmYNH2eBPSMhgBQXKRr0w6oVRL4x6YdQLo14Y9cKoF0a9QCO3jYLhBADvmFlNY69qsQAAAABJRU5ErkJggg==' ), 'label' => esc_html__( 'Left Sidebar', 'bigbang' ), ), 'sidebar-right' => array( 'url' => apply_filters( 'bigbang_layout_control_image_right', 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAABqAgMAAAAjP0ATAAAACVBMVEX///8+yP/V1dXG9YqxAAAAWUlEQVR42mNgGAUjB4iGgkEIzZStAoEVTECiQWsVkLdiECkboAABOmwBF9BtUGcOImUDEiCkJCQU0ECBslEvjHph1AujXhj1wqgXRr0w6oVRLwyEF0bBUAUAz/FTNXm+R/MAAAAASUVORK5CYII=' ), 'label' => esc_html__( 'Right Sidebar', 'bigbang' ), ), ); $wp_customize->add_setting( 'bigbang_page_sidebar_layout', array( 'sanitize_callback' => 'sanitize_key', 'default' => 'full-width', ) ); $wp_customize->add_control( new bigbang_Customize_Control_Radio_Image( $wp_customize, 'bigbang_page_sidebar_layout', array( 'label' => esc_html__( 'Page Sidebar Layout', 'bigbang' ), 'section' => 'bigbang_general', 'priority' => 15, 'choices' => $sidebar_choices, ) ) ); $default_blog_layout = bigbang_sidebar_on_single_post_get_default(); $wp_customize->add_setting( 'bigbang_blog_sidebar_layout', array( 'default' => $default_blog_layout, 'sanitize_callback' => 'sanitize_key', ) ); $wp_customize->add_control( new bigbang_Customize_Control_Radio_Image( $wp_customize, 'bigbang_blog_sidebar_layout', array( 'label' => esc_html__( 'Blog Sidebar Layout', 'bigbang' ), 'section' => 'bigbang_general', 'priority' => 20, 'choices' => $sidebar_choices, ) ) ); }// End if(). $wp_customize->add_setting( 'bigbang_enable_sharing_icons', array( 'default' => true, 'sanitize_callback' => 'bigbang_sanitize_checkbox', ) ); $wp_customize->add_control( 'bigbang_enable_sharing_icons', array( 'label' => esc_html__( 'Enable Sharing Icons', 'bigbang' ), 'section' => 'bigbang_general', 'priority' => 30, 'type' => 'checkbox', ) ); $wp_customize->add_setting( 'bigbang_enable_scroll_to_top', array( 'sanitize_callback' => 'bigbang_sanitize_checkbox', ) ); $wp_customize->add_control( 'bigbang_enable_scroll_to_top', array( 'label' => esc_html__( 'Enable Scroll to Top', 'bigbang' ), 'section' => 'bigbang_general', 'priority' => 40, 'type' => 'checkbox', ) ); // Boxed layout toggle. $wp_customize->add_setting( 'bigbang_general_layout', array( 'default' => 1, 'sanitize_callback' => 'bigbang_sanitize_checkbox', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'bigbang_general_layout', array( 'label' => esc_html__( 'Boxed Layout', 'bigbang' ), 'description' => esc_html__( 'If enabled, the theme will use a boxed layout.', 'bigbang' ), 'section' => 'bigbang_general', 'priority' => 50, 'type' => 'checkbox', ) ); } add_action( 'customize_register', 'bigbang_general_customize_register' ); /** * Get default option for sidebar layout * * @return string */ function bigbang_sidebar_on_single_post_get_default() { $bigbang_sidebar_on_single_post = get_theme_mod( 'bigbang_sidebar_on_single_post', false ); $bigbang_sidebar_on_index = get_theme_mod( 'bigbang_sidebar_on_index', false ); return $bigbang_sidebar_on_single_post && $bigbang_sidebar_on_index ? 'full-width' : 'sidebar-right'; }