postMessage */ function ct_author_enqueue_customizer_post_message_scripts(){ // JS for live updating with customizer input wp_enqueue_script('ct-author-customizer-post-message-js', get_template_directory_uri() . '/js/build/postMessage.min.js',array('jquery'),'',true); } add_action('customize_preview_init','ct_author_enqueue_customizer_post_message_scripts'); // load scripts asynchronously function ct_author_add_async_script($url) { // if async parameter not present, do nothing if (strpos($url, '#ct_author_asyncload') === false){ return $url; } // if async parameter present, add async attribute return str_replace('#ct_author_asyncload', '', $url)."' async='async"; } add_filter('clean_url', 'ct_author_add_async_script', 11, 1);