cdukes / bones-for-genesis-2-0

A starting point for new Genesis projects. Built for Genesis 3.* and WordPress 5.*+.
GNU General Public License v3.0
182 stars 61 forks source link

Image url adds css/ to string #3

Closed thewebprincess closed 11 years ago

thewebprincess commented 11 years ago

Hi Cooper

I'm doing my first project with bones and I am struggling with images. I notice that the image urls point to http:// - - /wp-content/themes/themename/css/images/s-specials-heading.png instead of just to the image.

How do I ensure the url doesn't go via the css dir, instead just to the theme images.

THanks

cdukes commented 11 years ago

Hi,

This seems like a general CSS issue, since there's nothing in BFG than hooks into image SRCs. What lines are you using for the image in your CSS?

background-image: url(images/s-specials-heading.png); will go to /themename/css/images/s-specials-heading.png

background-image: url(/images/s-specials-heading.png); will go to example.com/images/s-specials-heading.png

background-image: url(../images/s-specials-heading.png); will go to /themename/images/s-specials-heading.png

thewebprincess commented 11 years ago

Thanks Cooper, you nailed it. Still getting my head around sass, obviously. I put in /wp-content/themes/themename/images/s-specials-heading.png in the url() and ended up in the right place. Not sure if that's the right solution, but as it's working and I'm under the gun, I'm gonna go with it.

cdukes commented 11 years ago

I'd suggest coding the URLs relative to the asset, not the site root, so url(../images/s-specials-heading.png). The ../ means 'back up one folder'.

But otherwise, glad you were able to get it working.