Home / Admin / Combine and Minify CSS
Duplicate Snippet

Embed Snippet on Your Site

Combine and Minify CSS

Combine and Minify CSS

Code Preview
php
<?php
function combine_css_files() {
    wp_enqueue_style('combined-styles', get_template_directory_uri() . '/css/combined.min.css', array(), null, 'all');
    
    // Dequeue individual files if they are now part of the combined file
    wp_dequeue_style('style-one');
    wp_dequeue_style('style-two');
}
add_action('wp_enqueue_scripts', 'combine_css_files');

Comments

Add a Comment