Why not create a home.php template which will then be used as the home template for the site and then display the latest blog post with:
<?php $latestpost = new WP_Query("showposts=1"); while($latestpost->have_posts()) : $latestpost->the_post(); ?>
//do stuff here
<?php endwhile; ?>
if you want to display the date and the title of the posts, I like to use this code
<ul id="sidebar_updates">
<?php
$recentPosts = new WP_Query();
$recentPosts->query('showposts=5');
?>
<?php while ($recentPosts->have_posts()) : $recentPosts->the_post(); ?>
<li><strong><?php the_time('F j, Y'); ?></strong><br /><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></br></li>
<?php endwhile; ?>
</ul>
save that as “recentupdates.php” and to call it on the page use
<?php include (TEMPLATEPATH . "/recentupdates.php"); ?>
basic CSS
#sidebar_updates {
padding:0;
margin:0;
}
#sidebar_updates li {
list-style-type:none; padding-bottom:4px; padding-top:2px; font-size:12px;
}
Hey guys,
Thanks for your responses.
Equalmark, the latest post code is exactly what I was looking for.
Thanks guys!
Alex
Dear alofear
Thank you, thank you, thank you! I’ve wasted a lot of time trying to figure out the date thing using wp_get_archives which does not include the option to display the date. Your code works! Hooray.
I like your formatting too, especially the CSS with the indent for the repeated 1st selector. Nice job. Only if everyone would take the time to write clean code.
I can now list the last few post archives on a sidebar with the date and title.
I hope I can return the favor, if not to you, then to someone else
Fredz