Displaying one category on your WordPress main page

If you would like to only display a single category on your WordPress main page, here’s how you do it. You will need to start out by getting ID of the category you wish to display.   In WordPress 2.7+,  start out by going to your categories tab under posts(1), then hover over the category you would like to display in your post(2), don’t click on it, just hover over it.  On the bottom of your screen, you will be shown then URL of the category your hover over(3), remember the ID number that being displayed.   In the below example the number we need to remember is “23″.

Getting Category id

After you have gotten your categories ID number, you will next need to change your index.php file.  In your index.php file look for the line with “have_post” and add the below code after.

<?php if (have_posts()) : ?>; Look for this line and add below
<?php query_posts('showposts=10&amp;;cat=23'); ?>;
<?php while (have_posts()) : the_post(); ?>;

Last, change “cat” to the category id from above. “showposts” is the number of posts to display on the page.