Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS WordPress Child Theme images question

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #151650
    LightingGal1
    Participant

    Newbie here…

    I am trying to load a background image for my WP child theme, but it’s not working.

    I have added to the themes directory the child theme directory and style.css file inside. I’ve also added an images folder in my child theme directory. Other styles from my style.css are working except for the background image.

    At first, I hacked into the parent theme in the WP editor, and the background image was working then, and now with the child theme activated, it won’t. Fyi, I had copied the image into the child theme images folder, so I have it in two places actually.

    I am sure it has to do with my url to the image, but I’m at a loss.

    Directory looks like this:

    -wp-content /themes /portfolio-press-child /images/my_image.png

    #151702
    Senff
    Participant

    If your CSS file is located in the folder /wp-content/themes/portfolio-press-child/css and your images are in /wp-content/themes/portfolio-press-child/images, then you should be able to simply give that background image to an element by using this:

    background-image:url('../images/my_image.png');
    

    If it doesn’t show up, check if the image can be accessed directly by going straight to http://yourwebsiteurl/wp-content/themes/portfolio-press-child/images/my_image.png

    If not, we’d have to see a bit more of your site to see what could be wrong.

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘CSS’ is closed to new topics and replies.