Forums

[resolved] Controlling Specific Page Backgrounds and Navigation Elements (6 posts)

  1. lalindsey
    Member
    Posted 5 years ago #

    Hi!

    I hope I can explain this without babbling too much.

    I want to have a different background image, or color for certain pages that are powered by wordpress. For example, I may want the "about" page to have a blue background and the "Call Me" page to have a gray one.

    How would I do this in wordpress? I know the CSS, and whatever - but how would I call this in the template? I do stuff like this in Movable Type all the time, but since the templates are static, and the content is dynamic, I just add something like a ID to the body tag, and have that control different pages backgrounds.

    I have the same question about doing so with navigation elements, like is done in the "Blix" theme. I believe that's all controlled by PHP though - for example, when a visitor on the "home" page I want, say, the background of that navigation element to be yellow, instead of the default color of black.

    Thanks for any help!

  2. Samuel B
    moderator
    Posted 5 years ago #

    For the 1st part:
    http://codex.wordpress.org/Templates

    For the navigation elements, they should be in styl.css of your Blix theme (though I'm not familiar with it) and/or header.php.

  3. lalindsey
    Member
    Posted 5 years ago #

    Oh, thanks, I tried searching but I don't think I was specific enough.

    So, for example I would use a conditional like this:

    if (is_page('Call Me'))
    {
    echo '<body id="callme">';
    }

  4. Samuel B
    moderator
    Posted 5 years ago #

    That's a basic that works.

  5. moshu
    Member
    Posted 5 years ago #

    Although be aware that in most themes the <body> tag is in the header.php file - so you'll have to edit that file and not the Page template you create!

  6. Samuel B
    moderator
    Posted 5 years ago #

    Ach! Good point, moshu.

Topic Closed

This topic has been closed to new replies.

About this Topic