markjaquith / WP-Stack

A toolkit for creating professional WordPress deployments
1.11k stars 123 forks source link

CSS Background Image URL Not CDN'd #16

Open alexphelps opened 11 years ago

alexphelps commented 11 years ago

When using the CDN drop-in, all of the images using <img src="" /> seem to work properly with the URL getting replaced. On CSS Background Images though the URLs don't seem to be getting replaced.

Example - http://phoenix.prontomarketing.com/

The big background banner image is not using the CDN.

2013-07-18_13-00-10

Is this by design because most of the time CSS backgrounds use relative paths? It wouldnt get the CDN domain in that case either I suppose.

Thanks, Alex

marco-s commented 10 years ago

The CDN plugin is not able to change URLs for external JS/CSS files. If you add the CSS parts/definitions that need to point to the CDN to load inline (e.g. inside < head >< /head >, using the wp_head action) then the URLs can get modified to point to the CDN.

Or, you need to find another way to pre-process your CSS to change the URLs.

I hope that helps. Cheers!