Title: CSS minify not working
Last modified: August 22, 2016

---

# CSS minify not working

 *  [khao lak explorer](https://wordpress.org/support/users/khao-lak-explorer/)
 * (@khao-lak-explorer)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/css-minify-not-working/)
 * Hi,
    The CSS minify is not working, I already try to enque the style.css but 
   eh files are not minify and doesn t appears in the css file list.
 * IU used this to enque css:
    if ( ! is_admin() ) { wp_enqueue_style(‘style’, get_template_directory_uri().‘/
   style.css’, NULL, NULL, ‘all’ ); wp_enqueue_style(‘screen’, get_template_directory_uri().‘/
   screen.css’, NULL, NULL, ‘all’ ); wp_enqueue_style(‘style’, get_stylesheet_directory_uri().‘/
   style.css’, NULL, NULL, ‘all’ ); wp_enqueue_style(‘screen’, get_stylesheet_directory_uri().‘/
   screen.css’, NULL, NULL, ‘all’ );
 * }
 * It make the site very slow.
 * ANy help?
 * [https://wordpress.org/plugins/bwp-minify/](https://wordpress.org/plugins/bwp-minify/)

Viewing 14 replies - 1 through 14 (of 14 total)

 *  Plugin Author [Khang Minh](https://wordpress.org/support/users/oddoneout/)
 * (@oddoneout)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/css-minify-not-working/#post-5302198)
 * Where do you put the above codes?
 *  Thread Starter [khao lak explorer](https://wordpress.org/support/users/khao-lak-explorer/)
 * (@khao-lak-explorer)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/css-minify-not-working/#post-5302199)
 * The above codes are in the function.php of the child theme.
 * with this code when enqueue the wesbite load very slowly.
 * How to enque the style.css and screen.css and how to minify both?
 *  Plugin Author [Khang Minh](https://wordpress.org/support/users/oddoneout/)
 * (@oddoneout)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/css-minify-not-working/#post-5302200)
 * Did you wrap your wp_enqueue functions in an appropriate actions such as `init`?
 *  Thread Starter [khao lak explorer](https://wordpress.org/support/users/khao-lak-explorer/)
 * (@khao-lak-explorer)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/css-minify-not-working/#post-5302201)
 * I don t think so.
    How to do that?
 *  Plugin Author [Khang Minh](https://wordpress.org/support/users/oddoneout/)
 * (@oddoneout)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/css-minify-not-working/#post-5302202)
 * Check this out: [http://codex.wordpress.org/Function_Reference/wp_enqueue_script](http://codex.wordpress.org/Function_Reference/wp_enqueue_script)
 *  Thread Starter [khao lak explorer](https://wordpress.org/support/users/khao-lak-explorer/)
 * (@khao-lak-explorer)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/css-minify-not-working/#post-5302203)
 * So should I add this:
    function theme_name_scripts() { wp_enqueue_style( ‘style-
   name’, get_stylesheet_uri() ); wp_enqueue_script( ‘script-name’, get_template_directory_uri().‘/
   js/example.js’, array(), ‘1.0.0’, true ); }
 * add_action( ‘wp_enqueue_scripts’, ‘theme_name_scripts’ );
 * It s bit too technical for me.
    Appreciate your help.
 * Might have to change plug in if this plugin can t detect stylesheet.
 *  Plugin Author [Khang Minh](https://wordpress.org/support/users/oddoneout/)
 * (@oddoneout)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/css-minify-not-working/#post-5302204)
 * Yeah you can use that.
 *  Thread Starter [khao lak explorer](https://wordpress.org/support/users/khao-lak-explorer/)
 * (@khao-lak-explorer)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/css-minify-not-working/#post-5302205)
 * It doesnt work…
 * Any way to minify the css wihtout enqueuing it?
 *  Plugin Author [Khang Minh](https://wordpress.org/support/users/oddoneout/)
 * (@oddoneout)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/css-minify-not-working/#post-5302206)
 * Can you try again with `init` action instead? If those files are enqueued correctly
   they should be detected by the plugin.
 *  Thread Starter [khao lak explorer](https://wordpress.org/support/users/khao-lak-explorer/)
 * (@khao-lak-explorer)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/css-minify-not-working/#post-5302207)
 * can you provide the code to place in the function.php please.
 * I don t know how to do that.
 *  Thread Starter [khao lak explorer](https://wordpress.org/support/users/khao-lak-explorer/)
 * (@khao-lak-explorer)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/css-minify-not-working/#post-5302209)
 * I guess I will use WP Minify
 *  Plugin Author [Khang Minh](https://wordpress.org/support/users/oddoneout/)
 * (@oddoneout)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/css-minify-not-working/#post-5302210)
 * Try this:
 *     ```
       function theme_name_scripts() {
           wp_enqueue_style('style', get_stylesheet_directory_uri() . '/style.css');
           wp_enqueue_style('screen', get_stylesheet_directory_uri() . '/screen.css');
       }
       add_action( 'init', 'theme_name_scripts' );
       ```
   
 *  Thread Starter [khao lak explorer](https://wordpress.org/support/users/khao-lak-explorer/)
 * (@khao-lak-explorer)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/css-minify-not-working/#post-5302211)
 * Thanks but it doesnt really work, css load, but i think parents style doesn t
   load. everyhting very slow and still not appering in the minify css.
    I guess
   I give up on the css minify.
 * Is ther a way to force the emplacementt of the js minified files?
 *  Plugin Author [Khang Minh](https://wordpress.org/support/users/oddoneout/)
 * (@oddoneout)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/css-minify-not-working/#post-5302213)
 * You are right parent styles won’t be minified, it will be imported as is. I will
   think about improving this behaviour.
 * You can re-position JS files by navigating to BWP Minify > Manage enqueued files.

Viewing 14 replies - 1 through 14 (of 14 total)

The topic ‘CSS minify not working’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/bwp-minify.svg)
 * [Better WordPress Minify](https://wordpress.org/plugins/bwp-minify/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/bwp-minify/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/bwp-minify/)
 * [Active Topics](https://wordpress.org/support/plugin/bwp-minify/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/bwp-minify/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/bwp-minify/reviews/)

 * 14 replies
 * 2 participants
 * Last reply from: [Khang Minh](https://wordpress.org/support/users/oddoneout/)
 * Last activity: [11 years, 8 months ago](https://wordpress.org/support/topic/css-minify-not-working/#post-5302213)
 * Status: not resolved