• Resolved caughtredhanded

    (@caughtredhanded)


    This is my blog.

    At the moment, I have one background image that is the same for every single page of my site, however soon I am wanting to include a banner just under my nav bar and above my posts on the homepage, however I don’t want these to be showing on any other pages.

    With that in mind, how do I go about breaking up my background image, or having different background images on different pages so that I can accommodate having different content on different pages?

    I’m aware of conditional tags, which is fine, but I don’t see how to get different background images on different pages.

    Cheers!

Viewing 3 replies - 1 through 3 (of 3 total)
  • having different background images on different pages

    in header.php, after the lines with <link rel='stylesheet'... and before </head> , add something like:

    <style type="text/css">
    <?php if(is_page('about')) { ?>
    body { background-image: url(images/bg_about.png);
    <?php }
    elseif (is_page('archives')) { ?>
    body { background-image: url(images/bg_archives.png);
    <?php } ?>
    </style>

    how do I go about breaking up my background image

    difficult to do, the way it designed at the moment.

    Thread Starter caughtredhanded

    (@caughtredhanded)

    When I add that in I get a blank background image. Is it because I’m using conditional tags already further down in my header.php?

    Thread Starter caughtredhanded

    (@caughtredhanded)

    Problem solved. I simply used body_class and altered my css to reflect it. Now it’s working exactly the way that I wanted it. Lovely…

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Background images’ is closed to new replies.