How to use wp_enqueue_style() in my WordPress theme?

Not quite, but almost. What you want 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 sure you have do_action('wp_head'); in your header.php file and it should work just fine.

Leave a Comment