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' => 'bizbaby_customize_partial_blogname', ) ); $wp_customize->selective_refresh->add_partial( 'bizbaby_footer_message_option', array( 'selector' => '.business-description', ) ); $wp_customize->selective_refresh->add_partial( 'bizbaby_section_title_option', array( 'selector' => '.services-title', ) ); $wp_customize->selective_refresh->add_partial( 'bizbaby_banner_background_image_setting', array( 'selector' => '.major-banner', ) ); $wp_customize->selective_refresh->add_partial( 'bizbaby_footer_background_image_setting', array( 'selector' => '.site-footer__cover', ) ); $wp_customize->selective_refresh->add_partial( 'bizbaby_slogan_option', array( 'selector' => '.major-banner .titles h2', ) ); foreach (range(1, 6) as $id) { $card_settings = "bizbaby_service_card_$id"; $wp_customize->selective_refresh->add_partial( $card_settings . "title", array( 'selector' => ".service-item-$id h3", ) ); $wp_customize->selective_refresh->add_partial( $card_settings . "description", array( 'selector' => ".service-item-$id p", ) ); $wp_customize->selective_refresh->add_partial( $card_settings . "image", array( 'selector' => ".service-item-$id .service-image", ) ); } $wp_customize->selective_refresh->add_partial( 'blogdescription', array( 'selector' => '.site-description', 'render_callback' => 'bizbaby_customize_partial_blogdescription', ) ); } } add_action('customize_register', 'bizbaby_customize_register'); /** * Render the site title for the selective refresh partial. * * @return void */ function bizbaby_customize_partial_blogname() { bloginfo('name'); } /** * Render the site tagline for the selective refresh partial. * * @return void */ function bizbaby_customize_partial_blogdescription() { bloginfo('description'); } /** * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. */ function bizbaby_customize_preview_js() { wp_enqueue_script('bizbaby-customizer', get_template_directory_uri() . '/js/customizer.js', array('customize-preview'), BIZBABY_VERSION, true); } add_action('customize_preview_init', 'bizbaby_customize_preview_js');