So its been days since i've been looking into this and still found zero clue as to how to do it in my own custom theme. I've also had a look at this, but nothing. I had a look at the customizer of twenty-seventeen and found that the code responsible was
$wp_customize->selective_refresh->add_partial( 'blogname', array( 'selector' => '.site-title a', 'render_callback' => 'twentyseventeen_customize_partial_blogname', ) ); I tired the same with my customizer in my custom theme but it didn't work at all.
MY CODE
$wp_customize->add_section( 'footer_section', array( 'title' => __( 'Footer Section', 'healthtech' ), 'panel' => '', ) ); /* * Settings for copyright text */ $wp_customize->add_section( 'footer_section', array( 'title' => __( 'Footer Section', 'healthtech' ), 'panel' => '', ) ); /* * Settings for copyright text */ $wp_customize->add_setting( 'copyright_text', array( 'default' => '', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'copyright_text', array( 'label' => __( 'Copyright Text', 'healthtech' ), 'section' => 'footer_section', 'settings' => 'copyright_text', ) ) ); $wp_customize->selective_refresh->add_partial( 'copyright_text', array( 'selector' => 'span#copy-write', // You can also select a css class 'render_callback' => 'check_copy_right_text', ) ); Callback function for the render_callback
function check_copy_right_text(){ echo get_theme_mod('copyright_text'); } 