Support » Plugin: WP-LESS » [Plugin: WP-LESS] Compile directory

  • I have some problems with paths, when I include the plugin in a theme (Roots Theme)

    I use this code:

    require_once locate_template('/inc/wp-less/bootstrap-for-theme.php');          // LESS preprocessor
    function theme_wp_hook( ) {
    	$template_dir = str_replace("wp-content/", '', get_stylesheet_directory_uri());
    	wp_enqueue_style( 'bootstrap-less',   $template_dir . '/style.less', array( ), false, 'screen,projection' );
    add_action( 'wp', 'theme_wp_hook' );

    The library is in the parent theme (roots/inc/wp-less), and the less files either in the roots theme, or a child theme.

    Problem 1:
    When I use get_stylesheet_directory_uri(), the compiler will try to compile the wrong directory. (/home/admin/domains/ <– double wp-content)
    This can be fixed with manually removing wp-content, but is a bit strange.

    Problem 2:
    The file is now compiled, but the directory is wrong:
    This should be /wp-content/themes/roots-child/style-e450ce6cfc.css, (style-xx.css in the same dir as style.less). This way I can use relative images and don’t mess up my folder..
    (Ok, it does kinda work, but not the right way..)

    Otherwise great plugin (but an update for the latest release should help, but is easy to do by myself)

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: WP-LESS] Compile directory’ is closed to new replies.