WordPress.org

Support

Support » How-To and Troubleshooting » How only show posts of default category on the homepage ?

How only show posts of default category on the homepage ?

  • Hi eveyone,
    I’m using WordPress 2.04 and I want to only show posts of default category on the blog homepage. How do this work?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Modify your index.php (or home.php):

    Add the following before the loop:


    <?php
    query_posts("cat=1");
    ?>

    Replace the 1 with the category id of the category you want. You can find the id from admin->Manage->Catgories.

    HTH

    — KD

    It works well. Thanks a lot! (^_^)

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How only show posts of default category on the homepage ?’ is closed to new replies.
Skip to toolbar