Flexible Content Dynamic Preview – Change Style Render Path
-
Hello,
I am using the Dynamic Preview and would like to change the style Render Path.
I did follow this article (https://www.acf-extended.com/features/fields/flexible-content/dynamic-render). It sort of works in loading the correct css file, but it’s loading 4 times (screenshot https://snipboard.io/lgziKs.jpg). It’s basically loading the same css file for each flexible layout.Right now, all of my ACF flexible content layout CSS styles are compiled into a single css file called ‘admin-only-acfe.css’. I placed this code in my functions.php file:
add_filter('acfe/flexible/render/style', 'sp_acf_layout_style', 10, 4); function sp_acf_layout_style($file, $field, $layout, $is_preview){ $file = get_stylesheet_directory() . '/assets/admin-only-acfe.css'; return $file; }
Is there a way to load that css file ‘admin-only-acfe.css’ once, since all the flexible layout styles are in that file, instead of loading it for each layout?
Thank you!
- The topic ‘Flexible Content Dynamic Preview – Change Style Render Path’ is closed to new replies.