WordPress.org

Ready to get started?Download WordPress

Forums

How only show posts of default category on the homepage ? (3 posts)

  1. i777
    Member
    Posted 7 years ago #

    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?

  2. kdmurthy
    Member
    Posted 7 years ago #

    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

  3. i777
    Member
    Posted 7 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic