How to make get_theme_mod work with AJAX in the customizer preview
There is a bug in WordPress 4.8.2 which causes pending customized changes to not be injected into Ajax requests in the preview. This has been fixed in 4.9-alpha via #42162. In the mean time, however, you can do a workaround to modify the requested url with logic like: // Workaround defect introduced in WordPress 4.8.2 … Read more