WordPress.org

Ready to get started?Download WordPress

Forums

wp_cat_list one-level hierarchy (3 posts)

  1. alekone
    Member
    Posted 8 years ago #

    hi, I'd like to display only the first level of hierarchy in the category list. is this possible?
    now i'm using the string
    '<?php wp_list_cats('sort_column=id&optioncount=0
    &use_desc_for_title=0&children=0&hierarchical=1
    &hide_empty=0'); ?>'

    with children=1 I can see all the (2) levels of hierarchy.
    I would like to see only one!

    thank you.
    ale

  2. TechGnome
    Moderator
    Posted 8 years ago #

    Here's what mine looks like:

    wp_list_cats('children=0&hide_empty=0&
    sort_column=name&optioncount=0&
    use_desc_for_title=1');

    The only diff I can really see is the hierarchical setting, which you have set to 1. I think 0 is the default.

    -tg

  3. alekone
    Member
    Posted 8 years ago #

    ok, probably I've not expressed it well.
    I'd like to have
    ZERO
    ---ONE
    ---TWO
    ---THREE

    instead of
    ZERO
    ---ONE
    ----ONEsubA
    ----ONEsubB
    ---TWO
    ---THREE

    maybe it's only TWO levels of hierarchy instead of THREE or the whole hierarchy?
    thank you.
    ale

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.