Viewing 4 replies - 1 through 4 (of 4 total)
  • It depends where you want it to appear.

    <?php if (is_home())
    {
    echo '<div id="stuff">This is home page stuff</div>';
    }?>

    #stuff {
    width: 300px;
    text-align:center;
    margin: 0 auto;
    background-color: #ddd;
    }

    That’s basically it.

    Depends. If you have multi-file theme (index.php, single.php, page.php, etc) you could just add the code in index.php

    If you have only index.php as template for everything then you add the code in index.php but enclose it within a conditional statement.


    <?php if( is_home() ) { ?>
    // stuff that only takes effect in frontpage
    <?php } ?>

    Where does it go in index.php… after what…before what…

    where ever you want it to appear.

    -tg

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Ading code only in homepage’ is closed to new replies.