I'm building out my first WordPress site for any client. I actually want to use LESS for CSS and located a Wordpress wordpress plugin named WP-LESS.
Now, I'm total WordPress newb, however it seems this wordpress plugin requires me to utilize a function known as wp_enqueue_style() to inform WordPress to process the .less file.
I can not determine where I personally use this function. I looked during my header.php file during my theme directory and that i check this out.
<link rel="stylesheet" type="text/css" media="all"
href="<?php bloginfo( 'stylesheet_url' ); ?>" />
Shall We Be Held designed to replace this code with something similar to this?
<?php wp_enqueue_style('mytheme',
get_bloginfo('template_directory').'/style.less',
array('blueprint'), '', 'screen, projection'); ?>
You need to use wordpress_enqueue_style such as this (inside theme or perhaps a wordpress plugin):
`
wp_enqueue_style( 'my-style', get_template_directory_uri() . '/css/my-style.css', false, '1.0', 'all' ); // Inside a parent theme
wp_enqueue_style( 'my-style', get_stylesheet_directory_uri() . '/css/my-style.css', false, '1.0', 'all' ); // Inside a child theme
wp_enqueue_style( 'my-style', plugins_url( '/css/my-style.css', __FILE__ ), false, '1.0', 'all' ); // Inside a plugin
`
Less than, but almost. What for you to do is place a function in functions.php that queues your script.
So:
function addMyScript() {
wp_enqueue_style('mytheme', get_bloginfo('template_directory').'/style.less', array('blueprint'), '', 'screen, projection');
}
add_action('wp_head', 'addMyScript');
Then make certain you've do_action('wp_head'); inside your header.php file also it should work all right.