Viewing 4 replies - 1 through 4 (of 4 total)
  • where did you do the conditional?

    it would not work in style.css, php doesn’t work in a css file

    You would need to include the conditional up in your header.php file between the <head></head> tag

    what conditional did you use?

    Thread Starter aero313

    (@aero313)

    I did this in my header.php file:

    <body
    id=”<?php if (is_page_template(‘index.php’)){
    echo “home”;
    } else{
    echo “default”;
    }?>” >
    <div id=”wrapper” class=”hfeed”>
    <div id=”header”>
    <div id=”masthead”>
    <div id=”branding” role=”banner” height=”150px”>

    </div>

    The best way would be to simply replace your body tag with: <body <?php body_class(); ?>>

    You can then style all these elements:

    http://codex.wordpress.org/Template_Tags/body_class

    Thread Starter aero313

    (@aero313)

    thanks. I’m still missing something though —— what goes after the first line to add the styles?

    <?php if (is_page_template(‘index.php’)){
    echo “home”;
    } else{
    echo “”;
    }?>
    </head>

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘conditional tags / background image’ is closed to new replies.