1. Go to this page and download the library: Download icit/wp-less library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
icit / wp-less example snippets
// Include the class (unless you are using the script as a plugin)
'style', get_stylesheet_directory_uri() . '/style.less' );
// you can also use .less files as mce editor style sheets
add_editor_style( 'editor-style.less' );
// pass variables into all .less files
add_filter( 'less_vars', 'my_less_vars', 10, 2 );
function my_less_vars( $vars, $handle ) {
// $handle is a reference to the handle used with wp_enqueue_style()
$vars[ 'color' ] = '#000000';
return $vars;
}