selective_refresh ) ? 'postMessage' : 'refresh'; $wp_customize->add_panel( 'automotive_services_sidebar', array( 'priority' => 31, 'title' => esc_html__( 'Sidebar Option', 'automotive-services' ), ) ); /*========================================= Archive Post Section =========================================*/ $wp_customize->add_section( 'automotive_services_sidebar_settings', array( 'title' => esc_html__( 'Sidebar Option', 'automotive-services' ), 'priority' => 1, 'panel' => 'automotive_services_sidebar', ) ); // Archive Post Settings $wp_customize->add_setting( 'archive_post_settings' ,array( 'capability' => 'edit_theme_options', 'sanitize_callback' => 'automotive_services_sanitize_text', 'priority' => 1, ) ); $wp_customize->add_control( 'archive_post_settings', array( 'type' => 'hidden', 'label' => __('All Sidebar Setting','automotive-services'), 'section' => 'automotive_services_sidebar_settings', ) ); // Archive Sidebar Hide/ Show Setting // $wp_customize->add_setting( 'automotive_services_archive_sidebar_setting' , array( 'default' => '1', 'sanitize_callback' => 'automotive_services_sanitize_checkbox', 'capability' => 'edit_theme_options', 'priority' => 2, ) ); $wp_customize->add_control( 'automotive_services_archive_sidebar_setting', array( 'label' => esc_html__( 'Hide / Show Archive Sidebar', 'automotive-services' ), 'section' => 'automotive_services_sidebar_settings', 'settings' => 'automotive_services_archive_sidebar_setting', 'type' => 'checkbox' ) ); // Index Sidebar Hide/ Show Setting // $wp_customize->add_setting( 'automotive_services_index_sidebar_setting' , array( 'default' => '1', 'sanitize_callback' => 'automotive_services_sanitize_checkbox', 'capability' => 'edit_theme_options', 'priority' => 2, ) ); $wp_customize->add_control( 'automotive_services_index_sidebar_setting', array( 'label' => esc_html__( 'Hide / Show Index Sidebar', 'automotive-services' ), 'section' => 'automotive_services_sidebar_settings', 'settings' => 'automotive_services_index_sidebar_setting', 'type' => 'checkbox' ) ); // Pages Sidebar Hide/ Show Setting // $wp_customize->add_setting( 'automotive_services_paged_sidebar_setting' , array( 'default' => '1', 'sanitize_callback' => 'automotive_services_sanitize_checkbox', 'capability' => 'edit_theme_options', 'priority' => 2, ) ); $wp_customize->add_control( 'automotive_services_paged_sidebar_setting', array( 'label' => esc_html__( 'Hide / Show Pages Sidebar', 'automotive-services' ), 'section' => 'automotive_services_sidebar_settings', 'settings' => 'automotive_services_paged_sidebar_setting', 'type' => 'checkbox' ) ); // Search Result Sidebar Hide/ Show Setting // $wp_customize->add_setting( 'automotive_services_search_result_sidebar_setting' , array( 'default' => '1', 'sanitize_callback' => 'automotive_services_sanitize_checkbox', 'capability' => 'edit_theme_options', 'priority' => 2, ) ); $wp_customize->add_control( 'automotive_services_search_result_sidebar_setting', array( 'label' => esc_html__( 'Hide / Show Search Result Sidebar', 'automotive-services' ), 'section' => 'automotive_services_sidebar_settings', 'settings' => 'automotive_services_search_result_sidebar_setting', 'type' => 'checkbox' ) ); // Single Post Sidebar Hide/ Show Setting // $wp_customize->add_setting( 'automotive_services_single_post_sidebar_setting' , array( 'default' => '1', 'sanitize_callback' => 'automotive_services_sanitize_checkbox', 'capability' => 'edit_theme_options', 'priority' => 2, ) ); $wp_customize->add_control( 'automotive_services_single_post_sidebar_setting', array( 'label' => esc_html__( 'Hide / Show Single Post Sidebar', 'automotive-services' ), 'section' => 'automotive_services_sidebar_settings', 'settings' => 'automotive_services_single_post_sidebar_setting', 'type' => 'checkbox' ) ); // Sidebar Page Sidebar Date Hide/ Show Setting // $wp_customize->add_setting( 'automotive_services_single_page_sidebar_setting' , array( 'default' => '1', 'sanitize_callback' => 'automotive_services_sanitize_checkbox', 'capability' => 'edit_theme_options', 'priority' => 2, ) ); $wp_customize->add_control( 'automotive_services_single_page_sidebar_setting', array( 'label' => esc_html__( 'Hide / Show Page Width Sidebar', 'automotive-services' ), 'section' => 'automotive_services_sidebar_settings', 'settings' => 'automotive_services_single_page_sidebar_setting', 'type' => 'checkbox' ) ); $wp_customize->add_setting( 'automotive_services_sidebar_position', array( 'default' => 'right', 'sanitize_callback' => 'automotive_services_sanitize_sidebar_position', )); $wp_customize->add_control( 'automotive_services_sidebar_position', array( 'label' => __( 'Sidebar Position', 'automotive-services' ), 'section' => 'automotive_services_sidebar_settings', 'settings' => 'automotive_services_sidebar_position', 'type' => 'radio', 'choices' => array( 'right' => __( 'Right Sidebar', 'automotive-services' ), 'left' => __( 'Left Sidebar', 'automotive-services' ), ), )); } add_action( 'customize_register', 'automotive_services_sidebar_setting' );