If you want to customize your WordPress website by displaying recent posts from a specific category you can do that easily. For doing that you need to add the specific lines of code which you will need to copy in your template where you would like to display those recent posts.
<?php $the_query = new WP_Query( 'cat=3&posts_per_page=10&post_count=5' ); while($the_query->have_posts()) : $the_query->the_post(); ?> <ul> <li><h3><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3> <ul><li><?php the_content(); ?></li> </ul> </li> </ul> <?php endwhile; ?>
The above code will help you displaying the recent posts from a specific category on your WordPress blog. If you want to change the number of posts you want to display then change the number “post_count” value and the category can be changed from the “cat” section.