• Resolved cbeaman

    (@cbeaman)


    Hi,

    I am trying to have a different background image for each category and I am having some trouble. I read/attempted several of the forum discussions on this site with no luck. I did find one method that worked for me, but only in Firefox and not in IE or Safari.

    My site is https://www.robotspacebrain.com (I am using the Clean home theme)

    I found the solution from:

    so… from that, I put this in the header.php

    <body id="
    <?php if (is_category('robot')){
           echo "robot";}
    elseif (is_category('space')){
           echo "space";}
    elseif (is_category('brain')){
           echo "brain";}
    else{
    echo "default";
    }?>" >

    and I put this in the stylesheet.css

    */
    
    body#default { background:url(images/braincloseup4.jpg) top center no-repeat #000000; }
    body#robot { background:url(images/oldpaper2.jpg) top center no-repeat #000000;}
    body#space { background:url(images/oldpaper3.jpg) top center no-repeat #000000; }
    body#brain { background:url(images/braincloseup4.jpg) top center no-repeat #000000; }
    
    body {
        background-attachment: fixed;
        background-color: #000000;
        background-image: url('images/braincloseup4.jpg');
        background-position: left top;
        background-repeat: repeat;
        color: #3A3A3A;
        font-family: palatino,georgia,sans-serif;
        font-size: 12px;
        letter-spacing: 0.1px;
    }
Viewing 3 replies - 16 through 18 (of 18 total)
Viewing 3 replies - 16 through 18 (of 18 total)
  • The topic ‘Different Backgrounds for each Category’ is closed to new replies.