• My main theme uses lots of background images in style.css i.e.

    background: url('images/socialmedia.png')

    We want to create a new child theme (mostly just colour changes for a different sector in the business) that uses the main theme heavily.

    I created an /images/ folder in my child theme and added the new socialmedia.png image however the image is being served from the main theme.

    How do I make it serve from the child theme or is that not possible?

    Would I have to change the name of the image in the child theme stylesheet and place the new image in to main theme images folder, i.e.

    background: url('images/socialmedia-alt.png')

Viewing 2 replies - 1 through 2 (of 2 total)
  • No, you don’t put the image in the parent theme folder, but you do need to add it in the CSS of the child theme.
    CSS paths are relative to the stylesheet they are in.
    The child theme needs to have a rule for each new image, using the path to the new image. If you keep the names the same, you can just copy the rules from the parent.

    Thread Starter candell

    (@candell)

    Ah ok thanks. I hadn’t copied the rule to the child theme css, but placed the new image in the child theme image folder so it ignored it. If I copy the rule across, it will then take the image from the child theme also?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Using child theme image instead of main theme image’ is closed to new replies.