How can I List Recent Posts Excerpts

How can I List Recent Posts Excerpts

To list recent post excerpts in your theme you can do the following:

<?php
// change this to match the numbers of posts you want to display
$args = array( 'numberposts' => '3' );
// get them posts
$recent_posts = wp_get_recent_posts( $args );
// check there are some posts to display
if ( $recent_posts ) {
   echo '<ul>';
   foreach( $recent_posts as $recent ){
      echo '<li><a href="' . get_permalink($recent["ID"]) . '" title="Look '.esc_attr($recent["post_title"]).'" >' . $recent["post_title"].'</a></li>';
   }
   echo '</ul>';
}
?>