recent_posts_by_category
// Add Shortcode
function recent_posts_by_category( $atts ) {
// Attributes
extract( shortcode_atts(
array(
'category' => '1',
), $atts )
);
// Code
The <a href="http://www.dooneyscafe.com/archives/category/dictionary">dictionary</a> contains <b><?php _category_count(30); ?></b> definitions. Most recent: <br /><br />
<ul>
<?php
$dictPosts = new WP_Query();
$dictPosts->query('category_name=dictionary&showposts=10');
?>
<?php while ($dictPosts->have_posts()) : $dictPosts->the_post(); ?>
<li><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></li>
<?php endwhile; ?>
</ul>
<a href="http://dooneyscafe.com/archives/category/dictionary">Read more...</a>
<br />
<p>
</p>
}
add_shortcode( '[recent_posts_by_category]', 'recent_posts_by_category' );