Support » Fixing WordPress » static front page with the latest post

  • Resolved mabi404


    Hi folks,

    i got an static front page and a post site running.
    But i wan’t to have always the latest post on my static front page.
    Is that possible? If yes, how?

    thanks a lot

Viewing 5 replies - 1 through 5 (of 5 total)
  • yes. see this link

    If your static page is .html then change the file extension to .php .

    Try this:

     $postslist = get_posts('numberposts=1');
     foreach ($postslist as $post) :
            <div class="post"><h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
    <?php the_content() ?>
    <?php endforeach ?>


    Code works great. Many thanks.
    I am using it on a static front page with a template I created.

    Hi Guys,

    The code above by Nathan12343 works well. Using the editor I have placed the code into the “Page.php” template and the most recent post shows up under the static homepage. HOWEVER, these latest posts also show up for all the rest of my other pages… I only wish for it to show up on the homepage. I’ve tried putting the code into the “index.php” file but this isn’t working either. Anyone’s suggestions would be greatly appreciated!!!


    I’m using TwentyTen theme. Where to put the code in the page.php? It has loop.php seperately.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘static front page with the latest post’ is closed to new replies.