Support » Plugin: WP-LESS » [Plugin: WP-LESS] Root-relative paths

  • Resolved Marcus Fridholm


    I got irritated on an in all other respects superb plugin, because I needed to be able to set paths relative to root.

    background: url(/path/to/image);

    So I dug into it and in the file Plugin.class.php I found the solution. In the function filterStylesheetUri I changed the lines:

    $css = str_replace(
          array($token.'data:', $token),
          array('data:', dirname($stylesheet->getSourceUri()).'/'),


    $css = str_replace(
          array($token.'/', $token.'data:', $token),
          array('/', 'data:', dirname($stylesheet->getSourceUri()).'/'),

    Adding the “/” as a valid variant, just as “data:”.

    Hope this helps someone 😀

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author oncletom


    Hi Marcus, thanks for your tip.

    Would you recommend something special so as I could help you to push those things to be a built-in feature?

    Plugin Author oncletom


    Your problem may has been fixed within [this issue]( and in release 1.5.1

    Actually the only thing that bugs me, is lessc and how it chokes on some constructs like:
    *rule: value;

    This means som IE-specific code in Twitter Bootstrap creates errors on compilation.
    I’ve not dug into it to see why, rather I just commented out the offending lines, since they were not strictly necessary. But it still is slightly irritating if lessc can’t handle such mainstream code.

    This might or might not be a real problem, depending on versions of lessc and TB.

    If it stays a problem, and if I have the time to do something about it, I’ll let you know.

    Plugin Author oncletom


    Fine. It’s more a library-specific problem but if I can ease stuff, I’ll do.

    Thanks for have taken time to share that 🙂

    Yes that is not your fault, but a library problem. I shared it more as a “heads-up”.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: WP-LESS] Root-relative paths’ is closed to new replies.