How to create a theme customizer ‘sub’ panel?

You create Panels, and put Sections inside those Panels. So if you have your panel: $wp_customize->add_panel( ‘panel_id’, array( ‘priority’ => 10, ‘capability’ => ‘edit_theme_options’, ‘theme_supports’ => ”, ‘title’ => __(‘Theme Options’, ‘mytheme’), ‘description’ => __(‘Several settings pertaining my theme’, ‘mytheme’), ) ); Then you need to add your sections: $wp_customize->add_section( ‘header_settings’, array( ‘priority’ => 10, … Read more

How do I implement selective refresh with a customizer setting?

Create a function to output the selectively refreshed template code (I wrapped the HTML within <div class=”cta-wrap”> to make it easier to target this particular block of markup.) function wpse247234_cta_block() { if ( ( get_theme_mod( ‘intro_page’ ) ) != ” ) { $intro_id = get_theme_mod( ‘intro_page’ ); $intro_header = get_the_title( $intro_id ); $intro_excerpt = get_the_excerpt( … Read more