WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How do I list only sub categories of a particular categories? (4 posts)

  1. vvugia
    Member
    Posted 8 years ago #

    Hi, I am using the below tag (http://codex.wordpress.org/Template_Tags/list_cats). It would show all sub categories from all parent categories (which are not displayed...good!)
    <?php list_cats(FALSE, '', 'ID',
    'asc', '', TRUE, FALSE,
    FALSE, FALSE, TRUE,
    FALSE, TRUE, '', FALSE,
    '', '', '',
    TRUE); ?>

    What I want to do is to limit the display to just sub cat of a particular cat with ID = 6. The below code yielded empty

    <?php list_cats(FALSE, '', 'ID',
    'asc', '', TRUE, FALSE,
    FALSE, FALSE, TRUE,
    FALSE, TRUE, 6, '' , FALSE,
    '', '', '',
    TRUE); ?>

    What did I do wrong?

    Thanks in advance.

  2. vvugia
    Member
    Posted 8 years ago #

    This one is not working either:
    <?php wp_list_cats('sort_column=id&optioncount=0&use_desc_for_title=0&child_of=8'); ?>
    from
    http://codex.wordpress.org/Template_Tags/wp_list_cats

    Thanks for any suggestion!

  3. MichaelH
    Member
    Posted 8 years ago #

    What's that last example displaying for you?

    Shouldn't that be child_of=6?

  4. vvugia
    Member
    Posted 8 years ago #

    Hi Michael, I got it working and forgot to go back and close this thread.
    The code below did it.
    <?php wp_list_cats('sort_column=id&optioncount=0&child_of=6'); ?>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags