css - How to use less with php

423

i'm using wordpress and i would like to be able to change all the same color of my website by changing one php function on my admin panel. I tried to do that on my custom-style.php but it don't work :

@main_color: <?php the_field('main_color', 'option'); ?>;
a{
color: @main_color;
}

I also tried this way on my header.php :

<style type="text/css">
@main_color: <?php the_field('main_color', 'option'); ?>;
</style>
839

Answer

Solution:

Your browser doesn't recognize less. You have to compile less or use normal css.

524

Answer

Solution:

check below link i hope help you
lessphp

when you use external lib you must change file ext to .less.php good luck

People are also looking for solutions to the problem: php post method sender

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.