Only Viewing Child Categories (2 posts)

  1. thescott18
    Posted 11 years ago #

    Hey everyone, newbie here. I'm modifying a template, and it has the following code.

    {list_cats optionall='1' all='All' sort_column='name'}

    How can I get it so that it displays only the child categories of a particular index number? I've been searching, but all the results I find don't match up to this syntax.

  2. tangible
    Posted 11 years ago #

    if the particul post is under the parent AND child category:
    <?php wp_list_cats('children=1&child_of=X'); ?>
    X = the category ID of the parent that has the child categories you want to display


    if the particular post is only posted under the child category
    <?php wp_list_cats('hide_empty=0&children=1&child_of=2'); ?>

    of course you can add other options to that.. you can look it up in the WP codex

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.