WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Exclude category from archive (4 posts)

  1. morktron
    Member
    Posted 6 years ago #

    Hi, just wandering how to exclude a category from the archive in the sidebar.

    The 'loop' is beyond my comprehension at the moment.

  2. BPartch
    Member
    Posted 6 years ago #

    You add the &exclude=cat-id-number to the wp_list_categories function

    <ul>
    <?php
    wp_list_categories('orderby=name&show_count=1&exclude=10'); ?>
    </ul>

    More info...

  3. morktron
    Member
    Posted 6 years ago #

    Thanks BParth, that's a very useful and helpful thing to know. I'm very grateful.

    Is it possible to do this with the 'archive' function though?

    I tried this:

    <?php wp_get_archives('type=monthly&exclude=3'); ?>

    basically I just added '&exclude=3' from your code, but it still shows all the archives for all the categories.

  4. morktron
    Member
    Posted 6 years ago #

    After many a long time searching I found a solution:

    http://wordpress.org/support/topic/52819?replies=5

Topic Closed

This topic has been closed to new replies.

About this Topic