get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; if ( isset( $wp_customize->selective_refresh ) ) { $wp_customize->selective_refresh->add_partial( 'blogname', array( 'selector' => '.site-title a', 'render_callback' => 'switch_lite_customize_partial_blogname', ) ); $wp_customize->selective_refresh->add_partial( 'blogdescription', array( 'selector' => '.site-description', 'render_callback' => 'switch_lite_customize_partial_blogdescription', ) ); } // General setting $wp_customize->add_panel( 'general_settings', array( 'priority' => 20, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => esc_html__( 'General Settings', 'switch-lite' ), 'description' => esc_html__( 'General Settings', 'switch-lite' ), ) ); // Preloader section $wp_customize->add_section( 'preloader', array( 'priority' => 20, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => esc_html__( 'Preloader', 'switch-lite' ), 'description' => '', 'panel' => 'general_settings', ) ); // Preloader enable $wp_customize->add_setting( 'preloader_enable', array( 'default' => '', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => 'enable', 'sanitize_callback' => 'switch_lite_sanitize_checkbox', ) ); $wp_customize->add_control( 'preloader_enable', array( 'priority' => 20, 'section' => 'preloader', 'label' => esc_html__( 'Preloader Enable/Disable', 'switch-lite' ), 'description' => '', 'type' => 'checkbox', 'std' => '1' ) ); // Preloader Title // $wp_customize->add_setting('preloader_title', array( 'default' => esc_html__('SWITCH LOADING . . .','switch-lite'), 'sanitize_callback' => 'sanitize_textarea_field', 'transport' => 'refresh' )); $wp_customize->add_control( 'preloader_title', array( 'settings' => 'preloader_title', 'label' => esc_html__('Preloader Title','switch-lite'), 'section' => 'preloader', 'type' => 'textarea', 'priority' => 20, )); // Preloader section $wp_customize->add_section( 'global', array( 'priority' => 20, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => esc_html__( 'Global Options', 'switch-lite' ), 'description' => '', 'panel' => 'general_settings', ) ); $wp_customize->add_setting('font_size_body', array( 'default' => esc_html__('16','switch-lite'), 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'refresh' )); $wp_customize->add_control( 'font_size_body', array( 'settings' => 'font_size_body', 'label' => esc_html__('Body Font Size','switch-lite'), 'section' => 'global', 'type' => 'text', 'priority' => 20, )); //___Custom header image___// $wp_customize->add_panel( 'header_image', array( 'title' => esc_html__('Header Image', 'switch-lite'), 'priority' => 60, // Mixed with top-level-section hierarchy. ) ); $wp_customize->add_setting('title_text_align', array( 'default' => esc_html__('center','switch-lite'), 'sanitize_callback' => 'switch_lite_sanitize_select', 'transport' => 'refresh' )); $wp_customize->add_control( 'title_text_align', array( 'settings'=> 'title_text_align', 'label' => esc_html__('Title Alignment','switch-lite'), 'section' => 'header_image', 'type' => 'select', 'choices' => array( 'left' => esc_html__('Left','switch-lite'), 'center' => esc_html__('Center','switch-lite'), 'right' => esc_html__('Right','switch-lite'), ) )); // Menu options //___Custom menu Option___// $wp_customize->add_panel( 'nav_menus', array( 'title' => esc_html__('Menus Options', 'switch-lite'), 'priority' => 100, // Mixed with top-level-section hierarchy. ) ); $wp_customize->add_section( 'menu_options' , array( 'title' => esc_html__('Menu Options', 'switch-lite'), 'panel' => 'nav_menus', ) ); $wp_customize->add_setting('font_size', array( 'default' => esc_html__('14','switch-lite'), 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'refresh' )); $wp_customize->add_control( 'font_size', array( 'settings' => 'font_size', 'label' => esc_html__('Menu Font Size','switch-lite'), 'section' => 'menu_options', 'type' => 'text', )); $wp_customize->add_setting('text_transform', array( 'default' => esc_html__('uppercase','switch-lite'), 'sanitize_callback' => 'switch_lite_sanitize_select', 'transport' => 'refresh' )); $wp_customize->add_control( 'text_transform', array( 'settings'=> 'text_transform', 'label' => esc_html__('Text Transform','switch-lite'), 'section' => 'menu_options', 'type' => 'select', 'choices' => array( 'uppercase' => esc_html__('Uppercase','switch-lite'), 'lowercase' => esc_html__('Lowercase','switch-lite'), 'capitalize' => esc_html__('Capitalize','switch-lite'), ) )); //___Color Option___// $wp_customize->add_section( 'colors', array( 'title' => esc_html__('Custom Colors', 'switch-lite'), 'priority' => 40, ) ); //___Body text Color___// $wp_customize->add_setting( 'body_text_color', array( 'default' => '#424c57', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'refresh', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'body_text_color', array( 'label' => esc_html__( 'Body Text Color', 'switch-lite' ), 'type' => 'color', 'section' => 'colors', 'settings' => 'body_text_color', 'priority' => 9, ) ) ); //___theme primary Color___// $wp_customize->add_setting( 'theme_primary_color', array( 'default' => '#51BBE5', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'theme_primary_color', array( 'label' => esc_html__( 'Theme Primary Color', 'switch-lite' ), 'type' => 'color', 'section' => 'colors', 'settings' => 'theme_primary_color', 'priority' => 10, ) ) ); //___Header Background Color___// $wp_customize->add_setting( 'header_bg_color', array( 'default' => '#f8f8f8', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'header_bg_color', array( 'label' => esc_html__( 'Header Bg Color', 'switch-lite' ), 'type' => 'color', 'section' => 'colors', 'settings' => 'header_bg_color', 'priority' => 11, ) ) ); //___End header background option___// //___Menu Link Color___// $wp_customize->add_setting( 'nav_link_color', array( 'default' => '#444', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'nav_link_color', array( 'label' => esc_html__( 'Menu Color', 'switch-lite' ), 'type' => 'color', 'section' => 'colors', 'settings' => 'nav_link_color', 'priority' => 12, ) ) ); //___End menu link color option___// //___Menu Link hover Color___// $wp_customize->add_setting( 'nav_link_hover_color', array( 'default' => '#51BBE5', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'nav_link_hover_color', array( 'label' => esc_html__( 'Menu Hover & Active Color', 'switch-lite' ), 'type' => 'color', 'section' => 'colors', 'settings' => 'nav_link_hover_color', 'priority' => 13, ) ) ); //___End menu link color option___// //___Sidebar Selection___// $wp_customize->add_section('tx_sidebar_position', array( 'title' => esc_html__('SideBar Position', 'switch-lite'), 'priority' => 110, )); $wp_customize->add_setting('tx_sidebar', array( 'default' => esc_html__('right','switch-lite'), 'sanitize_callback' => 'switch_lite_sanitize_select', 'transport' => 'refresh' )); $wp_customize->add_control( 'tx_sidebar', array( 'settings'=> 'tx_sidebar', 'label' => esc_html__('Select Sidebar','switch-lite'), 'section' => 'tx_sidebar_position', 'type' => 'select', 'choices' => array( 'left' => esc_html__('Left','switch-lite'), 'right' => esc_html__('Right','switch-lite'), 'no_sidebar' => esc_html__('No Sidebar','switch-lite'), 'full_width' => esc_html__('Full Width','switch-lite'), ) )); // Footer section start $wp_customize->add_panel( 'footer', array( 'priority' => 558, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => esc_html__( 'Footer', 'switch-lite' ), 'description' => '', ) ); $wp_customize->add_section( 'footer_widget_option', array( 'priority' => 558, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => esc_html__( 'Footer', 'switch-lite' ), 'description' => '', 'panel' => 'footer', ) ); //___copyright Background Color___// $wp_customize->add_setting( 'footer_bg_color', array( 'default' => '#333', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'footer_bg_color', array( 'label' => esc_html__( 'Background Color', 'switch-lite' ), 'type' => 'color', 'section' => 'footer_widget_option', 'settings' => 'footer_bg_color', 'priority' => 14, ) ) ); //___copyright Background Color___// $wp_customize->add_setting( 'footer_widget_bg_color', array( 'default' => '#fff', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'footer_widget_bg_color', array( 'label' => esc_html__( 'Widget Bg Color', 'switch-lite' ), 'type' => 'color', 'section' => 'footer_widget_option', 'settings' => 'footer_widget_bg_color', 'priority' => 14, ) ) ); //___Footer widget ttile Color___// $wp_customize->add_setting( 'footer_widget_title_color', array( 'default' => '#333', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'footer_widget_title_color', array( 'label' => esc_html__( 'Widget Title Color', 'switch-lite' ), 'type' => 'color', 'section' => 'footer_widget_option', 'settings' => 'footer_widget_title_color', 'priority' => 14, ) ) ); //___copyright Background Color___// $wp_customize->add_setting( 'footer_widget_text_color', array( 'default' => '#333', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'footer_widget_text_color', array( 'label' => esc_html__( 'Widget Text Color', 'switch-lite' ), 'type' => 'color', 'section' => 'footer_widget_option', 'settings' => 'footer_widget_text_color', 'priority' => 14, ) ) ); $wp_customize->add_section( 'section_copyright', array( 'priority' => 558, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => esc_html__( 'Copyright', 'switch-lite' ), 'description' => '', 'panel' => 'footer', ) ); $wp_customize->add_setting('tx_copyright', array( 'default' => esc_html__('Proudly Powered by WordPress.','switch-lite'), 'sanitize_callback' => 'sanitize_textarea_field', 'transport' => 'refresh' )); $wp_customize->add_control( 'tx_copyright', array( 'settings' => 'tx_copyright', 'label' => esc_html__('Copyright Text','switch-lite'), 'section' => 'section_copyright', 'type' => 'textarea', )); // Credit enable $wp_customize->add_setting( 'credit_enable', array( 'default' => '', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'default' => 'true', 'sanitize_callback' => 'switch_lite_sanitize_checkbox', ) ); $wp_customize->add_control( 'credit_enable', array( //'priority' => 20, 'section' => 'section_copyright', 'label' => esc_html__( 'Credit Enable/Disable', 'switch-lite' ), 'description' => '', 'type' => 'checkbox', 'std' => '1' ) ); $wp_customize->add_setting('tx_facebook', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw', 'transport' => 'refresh' )); $wp_customize->add_control( 'tx_facebook', array( 'settings' => 'tx_facebook', 'label' => esc_html__('Facebook URL','switch-lite'), 'section' => 'section_copyright', 'type' => 'text', )); $wp_customize->add_setting('tx_twitter', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw', 'transport' => 'refresh' )); $wp_customize->add_control( 'tx_twitter', array( 'settings' => 'tx_twitter', 'label' => esc_html__('Twitter URL','switch-lite'), 'section' => 'section_copyright', 'type' => 'text', )); $wp_customize->add_setting('tx_dribble', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw', 'transport' => 'refresh' )); $wp_customize->add_control( 'tx_dribble', array( 'settings' => 'tx_dribble', 'label' => esc_html__('Dribble URL','switch-lite'), 'section' => 'section_copyright', 'type' => 'text', )); $wp_customize->add_setting('tx_linkedin', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw', 'transport' => 'refresh' )); $wp_customize->add_control( 'tx_linkedin', array( 'settings' => 'tx_linkedin', 'label' => esc_html__('Linkedin URL','switch-lite'), 'section' => 'section_copyright', 'type' => 'text', )); $wp_customize->add_setting('tx_pinterest', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw', 'transport' => 'refresh' )); $wp_customize->add_control( 'tx_pinterest', array( 'settings' => 'tx_pinterest', 'label' => esc_html__('Pinterest URL','switch-lite'), 'section' => 'section_copyright', 'type' => 'text', )); //___copyright Background Color___// $wp_customize->add_setting( 'copyright_bg_color', array( 'default' => '#51BBE5', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'copyright_bg_color', array( 'label' => esc_html__( 'Background Color', 'switch-lite' ), 'type' => 'color', 'section' => 'section_copyright', 'settings' => 'copyright_bg_color', 'priority' => 14, ) ) ); //___Copyright text Color___// $wp_customize->add_setting( 'text_color', array( 'default' => '#fff', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'text_color', array( 'label' => esc_html__( 'Text Color', 'switch-lite' ), 'type' => 'color', 'section' => 'section_copyright', 'settings' => 'text_color', 'priority' =>15, ) ) ); //___Icon Color___// $wp_customize->add_setting( 'icon_color', array( 'default' => '#fff', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'icon_color', array( 'label' => esc_html__( 'Icon Color', 'switch-lite' ), 'type' => 'color', 'section' => 'section_copyright', 'settings' => 'icon_color', 'priority' =>16, ) ) ); } add_action( 'customize_register', 'switch_lite_customize_register' ); // Custom Css function switch_lite_customize_css(){ ?>