• Resolved MatrixMedia

    (@matrixmedia)


    Hello!
    I may have spotted a bug when enabling CSS combination.
    In my stylesheet I have some rules like:
    background-image: url('/wp-content/[something]/image.jpg');
    Those works fine if CSS are not combined.
    When enabling CSS combination, those rules are rewritten like:
    background-image: url(https://www.somesite.com//wp-content/[something]/image.jpg)
    Note the missing quotes (‘) and the double slash (//).
    To make the option work, I replaced all rules with the static url like so:
    background-image: url(https://www.somesite.com/wp-content/[something]/image.jpg)

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Hristo Pandjarov

    (@hristo-sg)

    SiteGround Representative

    Can we have your site URL please so we can check it out? Generally, the plugin fixes relative paths without problems, so it must be an edge case!

    Thread Starter MatrixMedia

    (@matrixmedia)

    Yes, sure: https://www.trendhotels.it/
    The site is in production so I had to put the working URL or else it would not load some images, so you won’t see the error occurring.
    Can I help you with anything else?
    Thank you for your support!

    Plugin Author Stoyan Georgiev

    (@stoyangeorgiev)

    Hey there @matrixmedia,

    Since the Combined CSS is moved to the uploads folder, we are building the absolute path inside of the CSS to make sure all assets are loaded correctly.

    In your case, the path is not built correctly since you are adding relative URLs to the uploads directory and the URL is changed to domain.com/wp-content/themes/your-theme//wp-content/uploads/image as well as the double-slash you have given as an example.

    The proper way to add those properties to the CSS is ../../uploads/image. By doing this, the absolute URL will be built correctly and all images should be showing as expected. Also when using an asset from the uploads, you can always use the full URL instead of the relative one.

    Kind regards,
    Stoyan

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Possible BUG in CSS combination functionality’ is closed to new replies.