What's wrong in my code

Discussion in 'PHP' started by bala, Dec 2, 2010.

  1. #1
    I'm trying to use the if_home function inside our header.php file for a wordpress website. But its giving me problem. What may be the reason?

    The code

    <?php if (is_home() ) {
    <div id="optinsect">
    <div id="opt-in">
    } ?>
    </div></div>

    Thanks in advance

    Ok. Great. I figured this out..

    <?php if ( is_home() ) { ?>
    <div id="optinsect">
    <div id="opt-in">
    <!-- html goes here -->
    </div></div>
    <?php } ?>
     
    Last edited: Dec 2, 2010
    bala, Dec 2, 2010 IP
  2. w47w47

    w47w47 Peon

    Messages:
    255
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    be sure that is_home() returns true or false. else i can't see a problem in this piece of code.
     
    w47w47, Dec 6, 2010 IP