Forums

Exclude certain categories from the category list (3 posts)

  1. nando99
    Member
    Posted 3 years ago #

    Hi - I have a tv show blog where I provide episode summaries and reviews. I obviously use the normal generated category list to display all the show s and their different seasons. I'd also like to add a site news category and a tv news category. I do not want them listed in the same list as the tv show category.

    Is there anyway I can exclude certain categories from the default category list? I'd add the excluded categories somewhere else, hard coded.

    Thanks in advance

  2. Justin Tadlock
    Member
    Posted 3 years ago #

  3. nando99
    Member
    Posted 3 years ago #

    I see... i have a problem though.

    I'm using the code below to only show the parent categories and the child categories when inside the parent category:

    <div class="sideblock">
    <h3>Shows</h3>
    
    <ul>
    
    <?php
    $defaults = array(
    'show_option_all' => '',
    'orderby' => 'name',
    'order' => 'ASC',
    'show_last_update' => 0,
    'style' => 'list',
    'show_count' => 0,
    'hide_empty' => 0,
    'use_desc_for_title' => 1,
    'child_of' => 0,
    'feed' => '',
    'feed_image' => '',
    'exclude' => '',
    'hierarchical' => true,
    'title_li' => '',
    'echo' => 1,
    'depth' => 1
    );
    
    wp_list_cats($defaults); ?>
    
    </ul>
    
    </div>

    How do I add what I need to add to wp_list_cats($defaults);? I tried wp_list_cats($defaults&exclude=20); and that gives me an error.

    Thanks in advance.

Topic Closed

This topic has been closed to new replies.

About this Topic