The MU forums have moved to WordPress.org

Create static html page for the latest entry (excerpt) (3 posts)

  1. holesum
    Member
    Posted 17 years ago #

    Is there a way I can create a static html page each time which will automatically be updated each time I write a new entry.

    The result will be an html file that will ONLY contain the following:

    <a href="http://www.myblog.com/latest-entry-permalink">Blog Entry title</a>
    excerpt of the entry will go here...

    Hope someone can help! Thanks!

  2. andrea_r
    Moderator
    Posted 17 years ago #

    Yes.
    Create a home.php file in the theme folder of your choice. Add the bit of code that snags the latest entry.

    Like this:
    <?php
    query_posts('showposts=1');
    if (have_posts()) : ?><?php while (have_posts()) : the_post(); ?>
    <li><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title();?> </a></li>
    <?php endwhile; ?><?php endif; ?>

    The file can't end in HTML as it won't get updated. "automatically updated" and "static HTML" are mutually exclusive.

    This isn't a MU specific question either, so over at wordpress.org forums they might have more specifics too.

  3. josepo
    Member
    Posted 16 years ago #

About this Topic