LESS Compiler in child theme?

Posted in: Newspaper
Post count: 18

Hi Guys,

Could you please tell me how to use the LESS Compiler in my child theme?

I copied the less_files directory as well as the td_less_compiler.php to my child directory.

Then I told the compiler to echo $less->compileFile("less_files/main.less", "child.css") and then I was going to import child.css into style.css.

Then I tried to require_once('td_less_compiler.php') in my archive-blog.php template file, thinking that this would make it so it only compiled when I went to my ‘blog’ custom post type archive. That fails with an error about the include path.

What am I doing wrong?

Post count: 780

Hi,
you cannot use less in child themes easily because the child theme has to have the style in style.css. Are you working locally? If so:

* make a file style.less in the root of the child theme (where style.css is)
* copy less_files folder from the theme to the child theme
* add in style.less @import “less_files/main.less”;
* compile style.less to style.css via prepos http://alphapixels.com/prepros/ (ex: just drag and drop style.less in that program and it will compile it automatically to style.css)

keywords: less in child theme, using less, less compiler

Radu O.

Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic.