Jump to content


Photo
- - - - -

LESS in a child theme.


Best Answer Danny , 26 August 2013 - 10:16 AM

DO NOT USE define('PL_LESS_DEV',true);

on a Live site, it will cause the server melt down.

Go to the full post


  • Please log in to reply
22 replies to this topic

#1 quiteright

quiteright

    Member

  • Members

  • 17 posts
  • Country: Country Flag

Posted 06 March 2013 - 08:02 AM

I have a problem trying to get a custom .less file to work in a child theme i am building.

I made a style.less file, placed it in the "pagelines-template-theme" folder (same folder as the style.css file is located in).

When i try to add custom css or less to it, it does not pick it up! Though when i add the same css to the style.css file, it works just fine.

What am i missing here?



#2 Danny

Danny

    Is Awesome!

  • Moderators
  • 17931 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 06 March 2013 - 08:07 AM

Hi,

 

You most likely need to use a PageLines override, see here for assistance.

Please Login or Register to see this Hidden Content



#3 quiteright

quiteright

    Member

  • Members

  • 17 posts
  • Country: Country Flag

Posted 06 March 2013 - 08:16 AM

Tried both #page and #site, none of them make any difference.

Even if the custom code i wrote would be overwritten it would still show up as overwritten in chrome when i inspect the code right?

Nothing shows up... 



#4 Danny

Danny

    Is Awesome!

  • Moderators
  • 17931 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 06 March 2013 - 08:17 AM

What code are you using ?



#5 quiteright

quiteright

    Member

  • Members

  • 17 posts
  • Country: Country Flag

Posted 06 March 2013 - 08:40 AM

This is the original code for the startpage slider

 

.flexslider .slides img {

  1. width100%;
  2. displayblock;
}"
 
I am just trying to get it work so i changed it to
 
".flexslider .slides img {
  1. width10%;
} "
 
Also tried it with your suggestion 
 
"#page .flexslider .slides img {
  1. width10%;
}"
 
and
 
"#site .flexslider .slides img {
  1. width10%;
}"


#6 quiteright

quiteright

    Member

  • Members

  • 17 posts
  • Country: Country Flag

Posted 06 March 2013 - 08:43 AM

About the usage of #page and #site, should not the style.less file in my child theme be the last one to be read, and therefore overwrite the other ones?

If so why the need to use #page and #site to overwrite the other code?



#7 quiteright

quiteright

    Member

  • Members

  • 17 posts
  • Country: Country Flag

Posted 06 March 2013 - 08:59 AM

One more thing. When I look at the source code of the page - I can not find any reference to my style.less file. A reference to style.css is there, but no style.less. 



#8 Danny

Danny

    Is Awesome!

  • Moderators
  • 17931 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 06 March 2013 - 09:09 AM

I have just add the following to the style.less and the code worked without any issue.

 

Please Login or Register to see this Hidden Content

 

ttp://d.pr/i/GZjl

 

Therefore, if this isn't working, can you disable all non-PageLines plugins and see if the LESS CSS works.

 

If that doesn't resolve your issue, can you provide a screenshot of your FTP clients view for your child themes folder, so we can see the files please. Also, please add the contents of your style.less file to our pastie service and add a link to the past in your reply.

 

Please Login or Register to see this Hidden Content



#9 quiteright

quiteright

    Member

  • Members

  • 17 posts
  • Country: Country Flag

Posted 06 March 2013 - 10:29 AM

Ok, this time i made a completely new WP and pagelines install with no plugins, everything is updated and totally clean. Still no sign of function.

 

Please Login or Register to see this Hidden Content

 

there you got 3 screenshots of the situation.

 

And you got the code on 

Please Login or Register to see this Hidden Content



#10 Danny

Danny

    Is Awesome!

  • Moderators
  • 17931 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 06 March 2013 - 10:44 AM

The images of your FTP view for your child theme, looks fine. However, the link to the paste is the standard link, can you provide a link to your pastie, so we can view the code you're using in your style.less file.



#11 quiteright

quiteright

    Member

  • Members

  • 17 posts
  • Country: Country Flag

Posted 06 March 2013 - 10:48 AM

I don't understand what you mean?

All the code that is in the style.less is

 

body {

background-color: red;
}
 
Nothing else...


#12 quiteright

quiteright

    Member

  • Members

  • 17 posts
  • Country: Country Flag

Posted 06 March 2013 - 10:54 AM

Please Login or Register to see this Hidden Content



#13 Danny

Danny

    Is Awesome!

  • Moderators
  • 17931 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 06 March 2013 - 11:00 AM

I have just added your code to my test sites style.less and the background changed to the color red.

 

Can you provide a link to your site please.



#14 quiteright

quiteright

    Member

  • Members

  • 17 posts
  • Country: Country Flag

Posted 06 March 2013 - 11:01 AM

Please Login or Register to see this Hidden Content



#15 Danny

Danny

    Is Awesome!

  • Moderators
  • 17931 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 06 March 2013 - 11:25 AM

Ok, I see your problem, your CSS is loading but you have added a background color to your body in Color Control.

 

So try the following:

 

Please Login or Register to see this Hidden Content



#16 quiteright

quiteright

    Member

  • Members

  • 17 posts
  • Country: Country Flag

Posted 06 March 2013 - 01:07 PM

I got things to work now, though there is a big delay from when i update the less file through ftp, only found one way to speed it up, i go in to admin under pagelines in the browser and press "save" under website setup, then it goes through.

This is not a desire of mine, why i choose to use ftp is to quicken up the process. Is there any way to get around this "built in" cash thing you got going?



#17 Danny

Danny

    Is Awesome!

  • Moderators
  • 17931 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 06 March 2013 - 01:44 PM

There is, however it is not advised, as it will most certainly nuke your server. 



#18 quiteright

quiteright

    Member

  • Members

  • 17 posts
  • Country: Country Flag

Posted 06 March 2013 - 02:35 PM

will only use it during develop phase. When going sharp i will turn it back on... How do i do it?



#19 quiteright

quiteright

    Member

  • Members

  • 17 posts
  • Country: Country Flag

Posted 06 March 2013 - 02:52 PM

There we go, found my way.

 

 

define('PL_LESS_DEV',true);
define('WP_CACHE', false);
in wp_config!
 
Thanks for your help!
 
/best reg Erik

  • attac likes this

#20 attac

attac

    Super Member

  • Members
  • 132 posts
  • Country: Country Flag

Posted 26 August 2013 - 10:12 AM

thanks, this just solved my issue as well. It should be added to the documentation (if you plan on giving any more support to Framework customers?) that there will be a delay when you update less-files. How else should we know why it doesn't work?