WordPress shortcodes are a simple way to set up functions to create macro codes for use in post content. For instance, the following shortcode (in the post/page content) would add your recent posts into the page:
[php][recent-posts][/php]
Add this code to your functions.php file.
[php]
function my_recent_posts_shortcode($atts){
$q = new WP_Query(
array( ‘orderby’ => ‘date’, ‘posts_per_page’ => ‘4’)
);
$list = ‘<ul class="recent-posts">’;
while($q->have_posts()) : $q->the_post();
$list .= ‘<li>’ . get_the_date() . ‘<a href="’ . get_permalink() . ‘">’ . get_the_title() . ‘</a>’ . ‘<br />’ . get_the_excerpt() . ‘</li>’;
endwhile;
wp_reset_query();
return $list . ‘</ul>’;
}
add_shortcode(‘recent-posts’, ‘my_recent_posts_shortcode’);
[/php]
Add the shortcode to the page where you would like to pull in your recent posts.