Forums

[resolved] Disable current-cat for a specific category (3 posts)

  1. Indent
    Member
    Posted 2 years ago #

    I'm using this in the sidebar for displaying the three latest posts in the category sports:

    <?php query_posts('category_name=sports&showposts=3'); ?>
    <?php while (have_posts()) : the_post(); ?>
    <li>
    <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
    </li>
    <?php endwhile; ?>

    The problem is that the as long there are posts in this category, this category is hightlighted by current-cat in my category listing (wp_list_categories). And it also knocks out the current-cat for all other categories. Only the sports category is highlighted regardless of which category being displayed.

    Is there a way to disable the current-cat class for a specific category?
    Appreciate any help.

    Thanks!

  2. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    Have a look at the current_category parameter for wp_list_categories.

  3. Indent
    Member
    Posted 2 years ago #

    Thank you!

Topic Closed

This topic has been closed to new replies.

About this Topic