Flexible content render – compile styles
-
Hi i would like to use just one styleshhets in the preview mode for all my layout. because i use prepocessor SCSS.
I use the filter with param “name=” to point all the layout inside my Flexible content field. like this:
add_filter('acfe/flexible/render/style/name=my_name', 'acf_flexible_layout_render_style', 10, 4); function acf_flexible_layout_render_style($style, $field, $layout, $is_preview){ // Only in Ajax preview if($is_preview){ return get_stylesheet_directory_uri() . '/assets/css/acf-layout-styles-preview.css'; } return get_stylesheet_directory_uri() . '/assets/css/acf-layout-styles.css'; }
The problem is enqueue the same stylesheet repeatedly. as many as number of layouts on the same page ( Backend & Frontend )
Thanks in advance, awesome plugin!
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Flexible content render – compile styles’ is closed to new replies.