• Resolved elisabethviken

    (@elisabethviken)


    I’m making my own theme from scratch, but I can’t figure out how to fix this problem with adding a background image, because no matter what the background remains white. I’ve both tried to use Appearance-Background on WordPress and tried to code but nothing works, does anyone know how to fix this?

Viewing 12 replies - 1 through 12 (of 12 total)
  • Hello Elisabeth!

    Are you using a child theme, a theme framework or coding by yourself? If you are coding you can use a CSS code to insert your background. Clean and simple. Now if you want to add background support on your theme, take a look at this page:

    http://codex.wordpress.org/Custom_Backgrounds

    Hope it helps and good look on your project 😉

    Thread Starter elisabethviken

    (@elisabethviken)

    Hi, thanks for the answer. I’m coding by myself:) I’ve tried to insert a background image by using CSS, and I’m pretty sure I got the code right, but it just won’t appear. I have no functions.php file yet, is it necessary for the background to appear on my webpage?

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Maybe the path to the image is wrong.

    Did you try to use !important on the end of css declaration?

    Thread Starter elisabethviken

    (@elisabethviken)

    Thanks for trying to help Andrew, but this is my is my CSS body code:

    body {
    text-align: center;
    background-image: url(‘http://i58.tinypic.com/2njv704.jpg’)
    background-repeat: no-repeat;
    background-position: top center; }

    And I’ve placed the images in the the theme folder/images, so I’m pretty sure it’s okay? I’ve also tried to upload the picture to tinypic.com and used the direct link, but it didn’t appear that way either.

    Thread Starter elisabethviken

    (@elisabethviken)

    The !important code didn’t seem to work either, unfortunately.

    Is recommended your use a folder for your images. Make the things organized.

    Can you visualize your image link on your browser?

    Thread Starter elisabethviken

    (@elisabethviken)

    Yes, I have a folder for my images in the theme folder. Sorry I’m not sure if I understood, but yes if I go to ftp://ftp.domeneshop.no/www/wp-content/themes/cabintheme/images/strandbu.jpg and log in with my FTP info then I see the picture in the browser.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    The path to the image is wrong.

    .

    (@techievous)

    background-image: url(‘http://i58.tinypic.com/2njv704.jpg’)

    That’s the URL to the tinypic page that has the image, not a direct link to the image.

    The direct URL in this case woudl be: http://oi58.tinypic.com/2njv704.jpg

    ——–

    The reason why the image isn’t appearing when you link it from your internal site is probably a similar issue: a mistake in the path.

    Yes, I have a folder for my images in the theme folder. Sorry I’m not sure if I understood, but yes if I go to ftp://ftp.domeneshop.no/www/wp-content/themes/cabintheme/images/strandbu.jpg and log in with my FTP info then I see the picture in the browser.

    There’s absolute path and relative path. If you’re using relative path, there’s also difference between ../images/strandbu.jpg (notice the 2 dots in front) and images/strandbu.jpg.

    Make sure you’re using the correct relative path.

    Hello again!

    Can you provide your site URL? It will helps to help you.

    Thanks!

    Thread Starter elisabethviken

    (@elisabethviken)

    Hi, I started over with Lifehacker.com’s blank theme and now it works, but thank you for all your answers 🙂

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘Background image wont show’ is closed to new replies.