• I’m trying to add a background image to my WordPress website theme. Whatever I tried didn’t work, e.g. adding it via CSS, customizing the theme directly in WP. My site has a container; does that prevent a background image from being displayed by default?

    Here’s the body section of my style.css file:

    body {

    margin-left: 0px;

    margin-top: 0px;

    background-repeat: repeat; /* disabled 09/26/18, re-enabled 09/27/18 */

    background-image: url(“https://garykrupacpa.com/wordpress/wp-content/themes/mywebsite/the colors of cathedral rock by brian klimowski twilight scene.jpg”);

    background-attachment: fixed;

    opacity: .99;

    background-position: center;

    }

    I’m dumfounded that the background image will easily display in a web browser for the other pages on my site, but the WordPress blog page doesn’t display the BG image at all with the same code. Only the background color displays. Maybe that’s by default.

    Please help if you can.

    • This topic was modified 6 years, 2 months ago by gkcpa.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • hi

    gkcpa

    .site {
        /* background-color: #c2d1f0; */
        background-image: url(https://garykrupacpa.com/wordpress/wp-content/uploads/2018/09/the-colors-of-cathedral-rock-by-brian-klimowski-twilight-scene.jpg);
        background-repeat: no-repeat;
        background-size: cover;
    }

    is that ok for you
    i think some bug in the html
    body wont accept any css
    [ Signature moderated ]

    For your theme,if you have background Image in Customizer so use that it will help.
    Please check this screenshot. link

    Hope this helps.

    Thanks
    Suman W.

    • This reply was modified 6 years, 2 months ago by Suman.
    Thread Starter gkcpa

    (@gkcpa)

    Angelch, here are my updated body and BG image sections, per your suggestion –

    #body {
    margin-left: 0px;
    margin-top: 0px;
    }

    red_rock_image {
    background-image: url(“https://garykrupacpa.com/wordpress/wp-content/uploads/2018/09/the-colors-of-cathedral-rock-by-brian-klimowski-twilight-scene.jpg”);
    background-repeat: no-repeat;
    background-size: cover;
    }

    Although no error was reported by WP, this didn’t insert the background image. I then tried adding <div ID=”red_rock_image”> followed by </div> (at the bottom of the file)in header.php. That didn’t help either.

    I wish I could say it worked, but even though it didn’t, thank you! If you think of anything else that may work, please let me know.

    GKCPA

    Thread Starter gkcpa

    (@gkcpa)

    Hi Sumanm,

    As I said in my original post, I tried inserting the background image in customizer. It worked, but only if I selected a WP theme. I want to have displayed my custom website in WP, so I need to have the BG image appear with the website. I’m still looking for a way to do that. I created a previous version of my website in WP, but it didn’t feature a BG image, only a BG color. I still don’t know if what I want to do can be done. I may have to settle for having a BG color only. But thanks for your suggestion anyway. It was helpful.

    GKCPA

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Can’t add background image with container’ is closed to new replies.