Skip to content

change the compiled stylesheet path and URL

cheekyboots edited this page Sep 26, 2012 · 3 revisions

There are filters for the cache path and cache URL so you can change them and put the files into (for example) your child themes directory. This avoids conflicts, when you have got a parent and a child theme both using a style.css file and both get saved in the same location.

<?php
    add_filter( 'wp_less_cache_path', 'custom_less_cache_path' );
    add_filter( 'wp_less_cache_url', 'custom_less_cache_url' );

    function custom_less_cache_path( $path )
    {
        return get_stylesheet_directory().'/css';
    }

    function custom_less_cache_url( $url )
    {
        return get_stylesheet_directory_uri().'/css';
    }
?>
Clone this wiki locally