WordPress.org

Ready to get started?Download WordPress

Forums

How do I set the start page to only one category? (3 posts)

  1. Founder
    Member
    Posted 7 years ago #

    I have 2 categories in my Blog, I would like to have the Business Category to show on the first page when someone arrives.

  2. moshu
    Member
    Posted 7 years ago #

  3. tsguitar
    Member
    Posted 7 years ago #

    You can also just change the beginning of your loop. This change is to be made to your Main Index Template (Presentation >> Theme Editor):

    Change:
    <?php while (have_posts()) : the_post(); ?>

    to:
    <?php if (have_posts()) : query_posts($query_string .'&cat=-2'); while (have_posts()) : the_post();

    Also, change the category number to whatever category you want to exclude (just keep that "-" in front of the number). Since you only have 2 categories, there will only be one category that can display on your home page. If you ever add more categories, this solution may not work because you can only exclude one category.

Topic Closed

This topic has been closed to new replies.

About this Topic