WordPress.org

Support

Support » Miscellaneous » Hiding child categories.

Hiding child categories.

  • I spent about two hours looking for how to hide child categories and I didn’t see anything in the Codex, so I thought I would post another thread for others to find.

    If you want to hide the child categories, just use the following function in place of your current list_cats() function.

    <?php wp_list_cats(‘children=0’); ?>

    You may also want to check out.
    http://wordpress.org/support/topic/45095
    and
    http://codex.wordpress.org/Template_Tags/wp_list_cats

    I’ll try to add something to the WordPress codex. If anyone else could add something more on this to the wordpress codex I’d be greatful!

    Thanks,

    Adam

Viewing 6 replies - 1 through 6 (of 6 total)
  • hmmmm… odd, it won’t seem to work on my installation – I’m using WPmU would that be the reason?

    Kafkaesqui

    @kafkaesqui

    WPMU:

    http://mu.wordpress.org/forums

    They’d be more likely to know of variations (and bugs) with template tags in the multi-user version of WordPress.

    thanks – pretty quite over there.

    Also the wp_list_cats is placed in the header.php file – not sure if that makes a difference.

    Kafkaesqui

    @kafkaesqui

    All wp_list_cats() does is generate a list of categories. Unless one is modifying its behavior in some way, it should always work the same, no matter where it resides in your templates.

    hmm.. I wonder if it’s a bug?

    moved the them onto another wp installation, the children=0 thing worked fine. Guess it’s something in my installation.

    p

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Hiding child categories.’ is closed to new replies.
Skip to toolbar