I am looking to display x
(undecided) number of recent posts (no more than 10) on my home page. For each post, I would like to display the title and a snippet of the content. I can whip up a SQL query myself to get this but I was wondering what the WordPress function is to get this. The closest I have gotten is <?php wp_get_archives('type=postbypost&limit=10&format=html'); ?>
. I would also like to custom format the HTML. An example of the output I would like looks like this
<div id="posts">
<section class="post">
<h2><a href="[post uri]">[post title]</a></h2>
<p>[post snippet]</p>
</section>
<section class="post">
<h2><a href="[post uri]">[post title]</a></h2>
<p>[post snippet]</p>
</section>
</div>