Support » Requests and Feedback » wp_get_archives and get_archives – exclude category

  • I’m having a hell of a time trying to do this.

    Please implement this in the next version, it should’n be that hard to do.

Viewing 3 replies - 1 through 3 (of 3 total)
  • dleigh


    I 2nd the motion! Same problem!



    Trying to do what? What is it that you want to do, exactly? If you’re trying to list an archive page and exclude categories from that list, you can modify your Loop on that page:

    Or use query_posts to do it:

    Or, if that isn’t quite it, here’s my loop that excludes posts from category 2:
    <?php if (have_posts()) : query_posts($query_string .'&cat=-2'); while (have_posts()) : the_post();

    I’m now using

    <?php $temp_query = $wp_query; query_posts('showposts=10&cat=-9'); ?><br />
    <?php while (have_posts()) { the_post(); ?>
    <li><a>" rel="bookmark" title="Permanent Link to &ldquo;<?php the_title(); ?>&rdquo;"><?php the_title(); ?></a></li>
    <?php } $wp_query = $temp_query; ?>

    and than 9 excludes the catagory. The only problem I encounter now is that it not only excludes the catagory from my sidebar, but also from the content page… does anyone know why?


Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘wp_get_archives and get_archives – exclude category’ is closed to new replies.