Editing the homepage template?

Discussion in 'WordPress' started by bob25, Sep 13, 2009.

  1. #1
    I'm using the default settings (latest posts) on the homepage. I want to put some text so it only shows on the latest post (at the top of the page).

    When I try to edit the index.php the text shows up at the begining of each post on the page. I just want it to show once at the top of the page.

    Anyone know how to do this? Which file do I edit? :confused:

    Thanks
     
    bob25, Sep 13, 2009 IP
  2. ads2help

    ads2help Peon

    Messages:
    2,142
    Likes Received:
    67
    Best Answers:
    1
    Trophy Points:
    0
    #2
    You have to avoid THE LOOP

    Do not edit anything within this while statement

    <?php while (have_posts()) : the_post();
    ...
    ...
    ...
    endwhile;
    ?>
    
    PHP:
    Since you want to show on the latest post (at the top of the page), edit the part before while (have_posts()) : the_post();

    Cheers.
     
    ads2help, Sep 13, 2009 IP
  3. bob25

    bob25 Well-Known Member

    Messages:
    1,519
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    128
    #3
    Thanks it worked :D
     
    bob25, Sep 13, 2009 IP