Forums

Excluding categories from front page (5 posts)

  1. Kuriyaki
    Member
    Posted 1 year ago #

    How do I exclude the UNCATEGORIZED category, or any other category from appearing on the front page?

    I want the UNCATEGORIZED not to appear on my front page.

    http://kuriyaki.com

    Help would be appreciated! Thanks!

  2. jonimueller
    Member
    Posted 1 year ago #

    In your sidebar find this:

    <?php wp_list_categories(); ?>

    And change it to this:

    <?php wp_list_categories('exclude=1'); ?>

    This assumes that the "Uncategorized" category ID is 1. (Check by looking at your category list.) You can always exclude any number of categories. If you also wanted to exclude category ID 6, along with category ID 1, you'd put this:

    <?php wp_list_categories('exclude=1,6'); ?>

    Read about all the fun you can have with this tag here:
    http://codex.wordpress.org/Template_Tags/wp_list_categories

    HTH.

  3. Kalessin
    Member
    Posted 1 year ago #

    As an aside, the paradox of having posts categorized as "Uncategorized" leads me to rename the category to something like "General" every time I install WordPress.

  4. aguitta
    Member
    Posted 10 months ago #

    Hello,
    I would like to exclude the posts of a certain category to be excluded from the front page but be reacheble from the category list. Can this be done?.

  5. MichaelH
    moderator
    Posted 10 months ago #

    Add this before The Loop in your index.php

    <?php query_posts($query_string . '&cat=-1'); ?>

    See the template tag, query_posts().

Topic Closed

This topic has been closed to new replies.

About this Topic