WordPress.org

Ready to get started?Download WordPress

Forums

Exclude category from archive droplist (5 posts)

  1. staceyk18
    Member
    Posted 5 years ago #

    Is it possible to exclude a category from an archive droplist?

  2. stvwlf
    Member
    Posted 5 years ago #

    if you category list is being created with wp_list_categories, you can do something like this:

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

    The only part of that line you need to add to your existing code is the
    &exclude=10 where 10 stands for the category id you want to exclude. Just add that phrase onto the options that are already in the wp_list_categories line.

  3. staceyk18
    Member
    Posted 5 years ago #

    Hi...

    Doesnt seem to be working. I am using a get_archives though

    This is what I have:

    <form id="archiveform" action="">
    <label>Browse Archives</label>
    
    <select name="archive_chrono" onchange="window.location =
    (document.forms.archiveform.archive_chrono[document.forms.archiveform.archive_chrono.selectedIndex].value);">>
      <?php wp_get_archives('type=monthly&format=option&show_post_count=1&exclude=5'); ?> 	</select>
      </form>

    Any other ideas?

  4. oldbag66
    Member
    Posted 5 years ago #

    Ive got the same problem but get archives doesnt support a cat exclude function, this is supposed to solve it but i cant get it to work

    http://kwebble.com/blog/2007_08_15/archives_for_a_category

  5. llamaman
    Member
    Posted 5 years ago #

    I got kwebble.com's category plugin to work without issue. Perhaps it is conflicting with one of your other plugins?

Topic Closed

This topic has been closed to new replies.

About this Topic