I've searched the forums and Google high and low and it seems as though I can't find a solution to this problem. I am currently using a block of code that shows the most recent 5 posts to my blog. Can anyone show me what they would change in this block of code which would allow me to show the 5 recent articles from a specific category?
<? $today = current_time('mysql', 1);
if ( $recentposts = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE post_status = 'publish' AND post_date_gmt < '$today' ORDER BY post_date DESC LIMIT 0, 5")):
?><h2>Recent Articles:</h2>
<ul id="category_articles">
<?php foreach ($recentposts as $post) { if ($post->post_title == '') $post->post_title = sprintf(__('Post #%s'), $post->ID);
echo "<li><a href='".get_permalink($post->ID)."'>"; the_title(); echo"</a><small>"; the_date(); echo "</small></li>"; } ?>
</ul>
<?php endif; ?>