WordPress.org

Plugin Directory

wiki:ShowCats

Show Categories

Another of KittensPlugins

This plugin allows you to have individual WP loops for as many categories as you wish.


Despite the fact that this plugin seems to have entirely vanished, you don't need a plugin to achieve this.

See below for a simple example: (WP 1.5)

<?php if (have_posts()) : ?>
    <!-- first loop :: General Category -->
    <h2>General</h2>    
    <ul>
    <?php query_posts('category_name=General&showposts=6'); ?>
    <?php while (have_posts()) : the_post(); ?>
       <li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li>
    <?php endwhile; ?>
    </ul>

    <!-- Second loop :: CSS Category -->
    <h2>CSS</h2>    
    <ul>
    <?php query_posts('category_name=css&showposts=6'); ?>
    <?php while (have_posts()) : the_post(); ?>
       <li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li>
    <?php endwhile; ?>
    </ul>

<?php else : ?>
    <p>Oh crap, you broke it.</p>
<?php endif; ?>

It is possible to do the same in WP 1.2 without a plugin aswell, but it's messy.

Last modified 12 years ago Last modified on 04/06/06 22:13:19