Jump to content

Archived

This topic is now archived and is closed to further replies.

quiteright

LESS in a child theme.

Recommended Posts

quiteright    1
quiteright

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?

Share this post


Link to post
Share on other sites
quiteright    1
quiteright

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... 

Share this post


Link to post
Share on other sites
Danny    1,327
Danny

What code are you using ?


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
quiteright    1
quiteright

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%;
}"

Share this post


Link to post
Share on other sites
quiteright    1
quiteright

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?

Share this post


Link to post
Share on other sites
quiteright    1
quiteright

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. 

Share this post


Link to post
Share on other sites
Danny    1,327
Danny

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

 

#site .flexslider .slides img {
width: 10%;
}

 

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.

 

http://paste.pagelines.com/


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
Danny    1,327
Danny

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.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
quiteright    1
quiteright

I don't understand what you mean?

All the code that is in the style.less is

 

body {

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

Share this post


Link to post
Share on other sites
Danny    1,327
Danny

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.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
Danny    1,327
Danny

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:

 

body #site {
background-color: red;
}

Please search our forums, before posting!

Share this post


Link to post
Share on other sites
quiteright    1
quiteright

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?

Share this post


Link to post
Share on other sites
Danny    1,327
Danny

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


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
quiteright    1
quiteright

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

Share this post


Link to post
Share on other sites
quiteright    1
quiteright

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
  • Like 1

Share this post


Link to post
Share on other sites
Audun MB+    16
Audun MB

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?

Share this post


Link to post
Share on other sites
Danny    1,327
Danny

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

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


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
Audun MB+    16
Audun MB

Danny: Thanks for that advice, I figured as much, but hitting "Save options" did the trick for me. 

 

That you need to hit "Save options" for a updated .less-file to take effect should be in the support files though. 

Share this post


Link to post
Share on other sites
Rob    547
Rob

Glad to hear you found a solution.


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites

×