Title: compile .less files into css without enqueueing??
Last modified: August 21, 2016

---

# compile .less files into css without enqueueing??

 *  [saas](https://wordpress.org/support/users/saas/)
 * (@saas)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/compile-less-files-into-css-without-enqueueing/)
 * Hi,
    I was wondering if I could do something like this:
 *     ```
       foreach($my_less_files as $less_file){
             $lessConfig->setUploadDir($less_file['output_dir']);
             $lessConfig->setUploadUrl($less_file['output_url']);
            $WPLessPlugin->processStylesheet($less_file['file_path']);
       }
       ```
   
 * without first enqueueing it??? or with wp_register_sytle only (no enqueue)???
 * as opossed to this
    `wp_enqueue_style('my_css', 'path/to/my/style.css');` * `
   $WPLessPlugin->processStylesheet('my_css');`
 * ????
 * [http://wordpress.org/extend/plugins/wp-less/](http://wordpress.org/extend/plugins/wp-less/)

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

 *  Plugin Author [thom4](https://wordpress.org/support/users/oncletom/)
 * (@oncletom)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/compile-less-files-into-css-without-enqueueing/#post-3641175)
 * Why would you like not to enqueuing?
    It’s the recommended way of including CSS
   files into any template files.
 *  Thread Starter [saas](https://wordpress.org/support/users/saas/)
 * (@saas)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/compile-less-files-into-css-without-enqueueing/#post-3641176)
 * I am not using it on live site, I needed it for my development environment only,
   that’s why I didn’t want to enqueue it (as I have several skins compiled at same
   time, so in case of enqueue, they all will get loaded :(), so I wanted to play
   with register and then compile only registered files (filtered, only less files),
   and I was able to do it by forking your code and making it work for my development
   purposes only and its working fine so far (not ideal, but working ;))
 * So my suggestion is, you should allow some helper functions etc, so if user want
   to register some less files himself (via filter hooks or similar), and then your
   plugin should accept those less files and compile as per user requirement (just
   an idea, not necessarily everybody will be needing it).
 * Keep up the good work.

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

The topic ‘compile .less files into css without enqueueing??’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-less.svg)
 * [WP-LESS](https://wordpress.org/plugins/wp-less/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-less/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-less/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-less/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-less/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-less/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [saas](https://wordpress.org/support/users/saas/)
 * Last activity: [13 years, 1 month ago](https://wordpress.org/support/topic/compile-less-files-into-css-without-enqueueing/#post-3641176)
 * Status: not resolved