theme development – what is the best way to use postMessage refresh in customizer to load a template part using get_template part()?

Question

Let’s say I have a checkbox in the customizer. I want to load a file : /template-parts/components/author-info by this:

if (get_theme_mod('show_author_info')) {
    get_template_part('/template-parts/components/author-info');
}

I want to use postMessage or selective-refresh in the customizer. what’s the best way to do this?
Thanks for taking the time to read.

0
sabbir ahmed 2 months 2021-08-01T09:56:55-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse