Support » Plugin: Advanced Custom Fields: Extended » How can i combine all css in one file?

  • Resolved yamant112

    (@yamant112)


    Too many css files loads in flexible content blocks. How merge them in one file for optimization?

Viewing 1 replies (of 1 total)
  • Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    Thanks for the feedback and sorry for the late answer! You don’t need to use splitted CSS/JS files with the Flexible Content Dynamic Render. You can just enqueue a global custom CSS/JS files using the code available in the FAQ section: “How to enqueue new style/script files in the Flexible Content in PHP?”.

    Here is a usage example:

    add_action('acfe/flexible/enqueue/name=my_flexible', 'my_acf_flexible_enqueue', 10, 2);
    function my_acf_flexible_enqueue($field, $is_preview){
    
        // Only in Ajax preview
        if($is_preview){
    
            wp_enqueue_style('my-style-preview', 'https://www.example.com/style-preview.css');
    
        }
    
        wp_enqueue_style('my-style', 'https://www.example.com/style.css');
    
    }
    

    Hope it helps!

    Regards.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.