wp_get_archives and get_archives - exclude category (4 posts)

  1. Stahn
    Posted 10 years ago #

    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.

  2. dleigh
    Posted 9 years ago #

    I 2nd the motion! Same problem!

  3. tsguitar
    Posted 9 years ago #

    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();

  4. baster
    Posted 9 years ago #

    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?


Topic Closed

This topic has been closed to new replies.

About this Topic