Forums

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

Home Forums Back End [Solved] Changing Body Background

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #29207
    realph
    Participant

    Ok so I’ve got this bit of code in my header.php file:

    Code:
    >
    }

    Now on my home page, WP adds a class called "home" to my body tag, which i style like so:

    Code:
    .home {
    background: url(images/morning.jpg) repeat-x #fff;

    What I’d now like to do is show two different body backgrounds at different times in the day. So between the hours of 6am and 5pm I’d like the body background to be (morning.jpg) and between 6pm and 5am I’d like to to display a different body background image (night.jpg).

    How would I go about doing something like this?

    Thanks in advance!

    #77030
    TheDoc
    Member

    You could do something like this:

    Code:
    = 9 && $time < 18) { ?>

    #77080
    realph
    Participant
    "TheDoc" wrote:
    You could do something like this:

    Code:
    = 9 && $time < 18) { ?>

    Where would I place that in my code?

    #77117
    TheDoc
    Member

    That would be in your <head> section.

    #77123
    realph
    Participant

    No luck. I’m not having any background image show at all. Any ideas?

    #77154
    realph
    Participant

    Solved! Cheers TheDoc, and thanks for your patience.

    #77227
    TheDoc
    Member

    No worries – glad you got it sorted!

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