• Hello ??

    I have a page template named “home”

    On that certain page I want a different background image. So in home.php I added,

    <style>
    body { background:transparent url(images/topbkg.jpg) no-repeat scroll top center; }
    </style>

    For some reason the image doesn’t show. It does however if I edit style.css but I need topbkg.jpg just in the home page template.

    Does someone have any idea why this isn’t working? ?? …

Viewing 2 replies - 1 through 2 (of 2 total)
  • There’s a better way to add the background on a specific post/page including home page, if you replaced <body> in theme’s header.php with
    <body <?php body_class(); ?>>
    then add this in your theme’s style.css

    body.home {
    background:transparent url(images/topbkg.jpg) no-repeat scroll top center;
    }

    Thread Starter nemci7v

    (@nemci7v)

    aah thanks that’s neat!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Change body background on page template’ is closed to new replies.