Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • I can’t seem to make this work. I want to omit one category from my archives – ID 19 – so I used the following code on a template page names archives.php:


    <?php if(is_archive()){$wp_query->set('cat','-19'); query_posts(''); } ?>
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <ul><?php get_archives('postbypost','','custom','<li>','</li>'); ?></ul>
    <?php endwhile; else: ?>
    <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
    <?php endif; ?>

    What have I done wrong?

    Thread Starter kraetos

    (@kraetos)

    Thanks! does exactly what I need.

    I am looking to do exactly this, as well. That page you linked to, HandySolo, is just a generic “this is how to make an archives page,” which isn’t very helpful.

    My initial thought on how to do this is to create a loop on the archives page, and inside that loop, display nothing but the_title() and the_date(). But I tried doing this and I got nothing in return.

    Also, it would be great if you could omit a category from said archive page. Would you just put the entire thing inside an in_category() tag?

    Thanks

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