Ready to get started?Download WordPress


[resolved] Exclude category from archive (4 posts)

  1. morktron
    Posted 7 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
    Posted 7 years ago #

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

    wp_list_categories('orderby=name&show_count=1&exclude=10'); ?>

    More info...

  3. morktron
    Posted 7 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
    Posted 7 years ago #

    After many a long time searching I found a solution:


Topic Closed

This topic has been closed to new replies.

About this Topic