• Resolved bluantinoo

    (@bluantinoo)


    Hello,
    when I enable caching, images called from the theme’s CSS have a wrong path relative to the cache folder instead of the theme folder.

    Quick example.

    css file is wp-content/mytheme/css/mytheme.css

    images are in wp-content/mytheme/css/images/

    in css file I set the rule background-image: url("images/image.svg")

    in the cached version of css the image path is instead wp-content/cache/swift-performance/...

    but naturally the image is not there.. so nothing is shown

    is there a fix or I’m forced to use absolute path for css background images?

    • This topic was modified 2 years, 11 months ago by bluantinoo.
Viewing 1 replies (of 1 total)
  • Thread Starter bluantinoo

    (@bluantinoo)

    Solution found: just not use quotes for images url.

    So,
    if I use url("images/image.svg") images path are relative to cache folder
    if I use url(images/image.svg)images URLs in cached CSS is correctly generated as absolute URL and image is found.

    That’s weird. But solved

    • This reply was modified 2 years, 11 months ago by bluantinoo.
Viewing 1 replies (of 1 total)
  • The topic ‘Css Background Images Wrong Path’ is closed to new replies.