get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; $wp_customize->get_setting( 'background_color' )->transport = 'postMessage'; /* Add the logo section. */ $wp_customize->add_section( 'vssgroup_logo_upload', array( 'title' => esc_html__( 'Logo', 'vssgroup' ), 'priority' => 30, ) ); /* Add the 'logo' setting. */ $wp_customize->add_setting( 'logo_upload', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw', 'capability' => 'edit_theme_options', 'type' => 'option', ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'logo_image', array( 'label' => esc_html__( 'Upload custom logo.', 'vssgroup' ), 'section' => 'vssgroup_logo_upload', 'settings' => 'logo_upload', ) ) ); /* Add the Favicon section. */ $wp_customize->add_section( 'vssgroup_favicon_upload', array( 'title' => esc_html__( 'Favicon', 'vssgroup' ), 'priority' => 30, ) ); /* Add the 'Favicon' setting. */ $wp_customize->add_setting( 'favicon_upload', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw', 'capability' => 'edit_theme_options', 'type' => 'option', ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'favicon_image', array( 'label' => esc_html__( 'Upload custom favicon.', 'vssgroup' ), 'section' => 'vssgroup_favicon_upload', 'settings' => 'favicon_upload', ) ) ); /* Add the 'Slider Shortcode' setting. */ $wp_customize->add_section( 'vssgroup_slider_options', array( 'title' => esc_html__( 'Homepage Slider Option', 'vssgroup' ), 'priority' => 30, ) ); /* Add the 'Slider Shortcode' setting. */ $wp_customize->add_setting( 'slider_add', array( 'default' => '', 'sanitize_callback' => 'vssgroup_footer_sanitize_text', 'capability' => 'edit_theme_options', 'type' => 'option', ) ); $wp_customize->add_control( 'slider_add', array( 'label' => esc_html__( 'Paste Slider Shortcode Here', 'vssgroup' ), 'section' => 'vssgroup_slider_options', 'settings' => 'slider_add', 'type' => 'textarea', ) ); /* Add the 'Brand Logo Shortcode' setting. */ $wp_customize->add_section( 'vssgroup_brandlogo_options', array( 'title' => esc_html__( 'Homepage Brand Logo Option', 'vssgroup' ), 'priority' => 30, ) ); /* Add the 'Brand Logo Shortcode' setting. */ $wp_customize->add_setting( 'brandlogo_add', array( 'default' => '', 'sanitize_callback' => 'vssgroup_footer_sanitize_text', 'capability' => 'edit_theme_options', 'type' => 'option', ) ); $wp_customize->add_control( 'brandlogo_add', array( 'label' => esc_html__( 'Paste Brand Logo Shortcode Here', 'vssgroup' ), 'section' => 'vssgroup_brandlogo_options', 'settings' => 'brandlogo_add', 'type' => 'textarea', ) ); /* Add the Social Connect Section. */ $wp_customize->add_section( 'vssgroup_social_connect_url', array( 'title' => esc_html__( 'Social Connect Url', 'vssgroup' ), 'priority' => 30, ) ); /* Add the 'Facebook Url' setting. */ $wp_customize->add_setting( 'facebook_url', array( 'default' => '', 'sanitize_callback' => 'vssgroup_footer_sanitize_text', 'capability' => 'edit_theme_options', 'type' => 'option', ) ); $wp_customize->add_control( 'facebook_url', array( 'label' => esc_html__( 'Give Your Facebook Url.', 'vssgroup' ), 'section' => 'vssgroup_social_connect_url', 'settings' => 'facebook_url', 'type' => 'text', ) ); /* Add the 'twitter_url' setting. */ $wp_customize->add_setting( 'twitter_url', array( 'default' => '', 'sanitize_callback' => 'vssgroup_footer_sanitize_text', 'capability' => 'edit_theme_options', 'type' => 'option', ) ); $wp_customize->add_control( 'twitter_url', array( 'label' => esc_html__( 'Give Your Twiiter Url.', 'vssgroup' ), 'section' => 'vssgroup_social_connect_url', 'settings' => 'twitter_url', 'type' => 'text', ) ); /* Add the 'Linkedin_url' setting. */ $wp_customize->add_setting( 'linkedin_url', array( 'default' => '', 'sanitize_callback' => 'vssgroup_footer_sanitize_text', 'capability' => 'edit_theme_options', 'type' => 'option', ) ); $wp_customize->add_control( 'linkedin_url', array( 'label' => esc_html__( 'Give Your Linkedin Url.', 'vssgroup' ), 'section' => 'vssgroup_social_connect_url', 'settings' => 'linkedin_url', 'type' => 'text', ) ); /* Add the Copyright Text Section. */ $wp_customize->add_section( 'vssgroup_footer_options', array( 'title' => esc_html__( 'Footer Options', 'vssgroup' ), 'priority' => 30, ) ); /* Add the 'Copyright Text' setting. */ $wp_customize->add_setting( 'copy_name', array( 'default' => '', 'sanitize_callback' => 'vssgroup_footer_sanitize_text', 'capability' => 'edit_theme_options', 'type' => 'option', ) ); $wp_customize->add_control( 'copy_name', array( 'label' => esc_html__( 'Copyright Text.', 'vssgroup' ), 'section' => 'vssgroup_footer_options', 'settings' => 'copy_name', 'type' => 'text', ) ); /* Add the 'Designed Company Url' setting. */ $wp_customize->add_setting( 'design_url', array( 'default' => '', 'sanitize_callback' => 'vssgroup_footer_sanitize_text', 'capability' => 'edit_theme_options', 'type' => 'option', ) ); $wp_customize->add_control( 'design_url', array( 'label' => esc_html__( 'Designed Company Url', 'vssgroup' ), 'section' => 'vssgroup_footer_options', 'settings' => 'design_url', 'type' => 'text', ) ); /* Add the 'Designed Company Url' setting. */ $wp_customize->add_setting( 'design_name', array( 'default' => '', 'sanitize_callback' => 'vssgroup_footer_sanitize_text', 'capability' => 'edit_theme_options', 'type' => 'option', ) ); $wp_customize->add_control( 'design_name', array( 'label' => esc_html__( 'Designed Company Name', 'vssgroup' ), 'section' => 'vssgroup_footer_options', 'settings' => 'design_name', 'type' => 'text', ) ); /* Add the 'Contact Page' setting. */ $wp_customize->add_section( 'vssgroup_contact_options', array( 'title' => esc_html__( 'Contact Page Options', 'vssgroup' ), 'priority' => 30, ) ); /* Add the 'Copyright Branch Text' setting. */ $wp_customize->add_setting( 'cont_add', array( 'default' => '', 'sanitize_callback' => 'vssgroup_footer_sanitize_text', 'capability' => 'edit_theme_options', 'type' => 'option', ) ); $wp_customize->add_control( 'cont_add', array( 'label' => esc_html__( 'Branch Address.', 'vssgroup' ), 'section' => 'vssgroup_contact_options', 'settings' => 'cont_add', 'type' => 'textarea', ) ); /* Add the 'Copyright Branch Phoneno' setting. */ $wp_customize->add_setting( 'cont_phone', array( 'default' => '', 'sanitize_callback' => 'vssgroup_footer_sanitize_text', 'capability' => 'edit_theme_options', 'type' => 'option', ) ); $wp_customize->add_control( 'cont_phone', array( 'label' => esc_html__( 'Branch Phone No.', 'vssgroup' ), 'section' => 'vssgroup_contact_options', 'settings' => 'cont_phone', 'type' => 'text', ) ); /* Add the 'Copyright Head Office Text' setting. */ $wp_customize->add_setting( 'cont_head_add', array( 'default' => '', 'sanitize_callback' => 'vssgroup_footer_sanitize_text', 'capability' => 'edit_theme_options', 'type' => 'option', ) ); $wp_customize->add_control( 'cont_head_add', array( 'label' => esc_html__( 'Head Office Address.', 'vssgroup' ), 'section' => 'vssgroup_contact_options', 'settings' => 'cont_head_add', 'type' => 'textarea', ) ); /* Add the 'Copyright Branch Phoneno' setting. */ $wp_customize->add_setting( 'cont_head_phone', array( 'default' => '', 'sanitize_callback' => 'vssgroup_footer_sanitize_text', 'capability' => 'edit_theme_options', 'type' => 'option', ) ); $wp_customize->add_control( 'cont_head_phone', array( 'label' => esc_html__( 'Head Office Phone No.', 'vssgroup' ), 'section' => 'vssgroup_contact_options', 'settings' => 'cont_head_phone', 'type' => 'text', ) ); /* Add the 'Contact Form Shortcode Phoneno' setting. */ $wp_customize->add_setting( 'cont_form_phone', array( 'default' => '', 'sanitize_callback' => 'vssgroup_footer_sanitize_text', 'capability' => 'edit_theme_options', 'type' => 'option', ) ); $wp_customize->add_control( 'cont_form_phone', array( 'label' => esc_html__( 'Paste Your Contact Form 7 Shortcode', 'vssgroup' ), 'section' => 'vssgroup_contact_options', 'settings' => 'cont_form_phone', 'type' => 'textarea', ) ); } add_action( 'customize_register', 'vssgroup_customize_register' ); // sanitize function function vssgroup_footer_sanitize_text( $input ) { return wp_kses_post( force_balance_tags( $input ) ); } function vssgroup_customize_preview_js() { wp_enqueue_script( 'vssgroup_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20130508', true ); } add_action( 'customize_preview_init', 'vssgroup_customize_preview_js' );