how can i make the "recent posts" in the WP sidebar show posts from a particular category only?
Use the Recent Posts widget. To start, choose Appearance > Widgets from your WordPress dashboard. Then, drag and drop the widget labeled Recent Posts into your sidebar.
You can find it in the Themename Options > Blog section. For this article, we used the Behold theme, where the option for showing related posts is called Enable Related Posts. After enabling the appropriate option, you should check for the appearance of the related posts section by examining one of your blog posts.
In the WordPress sidebar, hover over Appearance and select Widgets from the pop-out contextual menu. Drag and drop the Categories widget from the list of Available Widgets on the left side of the screen into a location on the right side of the screen, such as Default Sidebar.
Probably easiest to make your own recent posts widget with one of Otto's php code widgets http://wordpress.org/extend/plugins/php-code-widget/ and a new query:
<?php $my_query = new WP_Query('category_name=mycategory&showposts=1'); ?>
<?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
<a href="<?php the_permalink() ?>" title="<?php the_title(); ?>">
<?php the_title(); ?></a>
<?php endwhile; ?>
Style it any way you want. The new query loop won't conflict with the main WP loop and can be used any numbers of time.
Or if you prefer something a little more user-friendly(doesn't require posting code into the widget), you may find the following plugin of use.
http://wordpress.org/extend/plugins/query-posts/
Nice little plugin that one, written by Justin Tadlock.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With