Customizer live preview not working, refreshes but nothing change
Well, by some experiments, I found the answer. get_theme_mod won’t get you the real-time value when called in ‘after_setup_theme’ or ‘init’, it does work in ‘customize_preview_init’ and ‘wp_loaded’, so the working code: add_action(‘customize_preview_init’, ‘my_header’ ); function my_header() { if(get_theme_mod(‘enable_vertical_header’)) { $vertical_header = new Vertical_Header; } }