Show latest posts in the sidebar

By | April 30, 2009

Okay, this is a super simple thing to do, and may be not worth posting, but if you are working on a theme yourself, this is something that is an essential addition to your sidebar.php file, and makes it easier for the user if they don’t want to mess around with widgets too much. You can also use this in your index.php file or footer.php file if you’re going for some pretty innovative things.

<ul>
<?php wp_get_archives('type=postbypost&limit=4'); ?>
</ul>

Voila! Doesn’t get much easier than that does it?