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', 'render_callback' => 'bitstream_customize_partial_blogname', ) ); $wp_customize->selective_refresh->add_partial( 'blogdescription', array( 'selector' => '.site-description', 'render_callback' => 'bitstream_customize_partial_blogdescription', ) ); } $wp_customize->add_setting('bitstream_color_scheme', array( 'default' => esc_html__('#2ed9f5','bitstream'), 'sanitize_callback' => 'sanitize_hex_color' ) ); $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize,'bitstream_color_scheme',array( 'label' => esc_html__('Color Scheme','bitstream'), 'description' => esc_html__('Change Theme Color','bitstream'), 'section' => 'colors', 'settings' => 'bitstream_color_scheme' )) ); } add_action( 'customize_register', 'bitstream_customize_register' ); /** * Render the site title for the selective refresh partial. * * @return void */ function bitstream_customize_partial_blogname() { bloginfo( 'name' ); } /** * Render the site tagline for the selective refresh partial. * * @return void */ function bitstream_customize_partial_blogdescription() { bloginfo( 'description' ); } /** * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. */ function bitstream_customize_preview_js() { wp_enqueue_script( 'bitstream-customizer', get_template_directory_uri() . '/assets/js/customizer.js', array( 'customize-preview' ), '20151215', true ); } add_action( 'customize_preview_init', 'bitstream_customize_preview_js' );