WordPress.org

Ready to get started?Download WordPress

Forums

Show one category (2 posts)

  1. davey579
    Member
    Posted 6 years ago #

    I have a post with 2 categories (for example: A and B). If I use:
    <?php the_category(',') ?>
    I see both categories, but I would like to show only one category (for example only category B). How can I do this?

  2. whistler2020
    Member
    Posted 6 years ago #

    <h2 class="widgettitle">Categories</h2>
    <ul>
    <?php wp_list_categories('exclude=##,##,##','&title_li'); ?>
    </ul>

    where ## is the category number to exclude

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags