customizer dynamic stylesheet not showing live edits
-
Hi I am using this code but even with jquery it won’t live update the css, even on publish. I am using a dynamic css stylesheet rather than another bloat of css inline as WordPress adds its own as well does any plugin and theme.
add_action('parse_request', 'parse_dynamic_css_request'); function parse_dynamic_css_request($wp) { $ss_dir = get_stylesheet_directory(); // Shorten code, save 1 call ob_start(); // Capture all output (output buffering) require($ss_dir . '/designer.css.php'); // Generate CSS $css = ob_get_clean(); // Get generated CSS (output buffering) file_put_contents($ss_dir . '/designer.css', $css, LOCK_EX); // Save it } function designer_customize_register( $wp_customize ) {
I am using customizer functions to create e.g. colors and it all works well and updates the designer.css stylesheet that I have enqueued.
Is it possible to see live changes? It shows up if I update and clear the browser cache but that is not the aim I want it to be dynamic or is this only going to work using inline css?
Thanks
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘customizer dynamic stylesheet not showing live edits’ is closed to new replies.