get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; if ( isset( $wp_customize->selective_refresh ) ) { $wp_customize->selective_refresh->add_partial( 'blogname', array( 'selector' => '.site-title a', 'container_inclusive' => false, 'render_callback' => 'blogpress16_customize_partial_blogname', ) ); $wp_customize->selective_refresh->add_partial( 'blogdescription', array( 'selector' => '.site-description', 'container_inclusive' => false, 'render_callback' => 'blogpress16_customize_partial_blogdescription', ) ); } } add_action( 'customize_register', 'blogpress16_customize_register', 11 ); /** * Render the site title for the selective refresh partial. * @return void */ function blogpress16_customize_partial_blogname() { bloginfo( 'name' ); } /** * Render the site tagline for the selective refresh partial. * @return void */ function blogpress16_customize_partial_blogdescription() { bloginfo( 'description' ); } function blogpress16_customizer_register($wp_customize){ $wp_customize->add_section('my_sidebar',array( 'title' => __('Sidebar Layout','blogpress-16'), 'description' => 'Modify the layout' )); $wp_customize->add_setting('sidebar_setting',array( 'default' =>'left', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('sidebar_select',array( 'label' => __('Sidebar Location','blogpress-16'), 'section' => 'my_sidebar', 'settings' => 'sidebar_setting', 'type' => 'radio', 'priority' => 1, 'choices' => array( 'left' => 'Right Sidebar', 'right' => 'Left Sidebar' ) )); $wp_customize->add_section('copyright',array( 'title' => __('Copyright Text','blogpress-16'), 'description' => 'Edit the Footer Text' )); $wp_customize->add_setting('copyright_setting',array( 'default' =>'', 'sanitize_callback' => 'bookish_sanitize_textarea', )); $wp_customize->add_control('copyright',array( 'label' => __('copyright','blogpress-16'), 'section' => 'copyright', 'settings' => 'copyright_setting', 'type' => 'textarea', 'priority' => 1, )); } function bookish_sanitize_textarea( $text ) { return esc_textarea( $text ); } function blogpress16_css_customizer(){ ?>