WordPress.org

Ready to get started?Download WordPress

Forums

"Tree" Category list (9 posts)

  1. wellofdreams
    Member
    Posted 8 years ago #

    I know this has been asked before, but the Codex is SO hard to find stuff in...

    How do you display the categories as a "tree" (i.e. parent cats and child cats)?

    Thanks x

  2. ladydelaluna
    Member
    Posted 8 years ago #

    http://codex.wordpress.org/Template_Tags/wp_list_pages

    Everything you need to know is there... and it wasn't hard to find, I just went up to the search box and typed in "list pages"

  3. Eh, this is actually what you want:

    http://codex.wordpress.org/Template_Tags/wp_list_cats

    Specificly the "hierarchical" option.

    This is what I use for example:

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

  4. wellofdreams
    Member
    Posted 8 years ago #

    Thanks Viperbond - I still couldn't figure it out with whoosiwhat's 'instructions'... :)

    Is there a way to indent the child cats?

  5. ladydelaluna
    Member
    Posted 8 years ago #

    sorry - viper's right... lol i went to pages and not categories... thanks for the correction, VB ;)

    [Moderated]

  6. Is there a way to indent the child cats?

    They are indented, unless your CSS is screwing with it. Child categories get placed in nested ul tags.

    Example on my site (click my name).

  7. ladydelaluna
    Member
    Posted 8 years ago #

    VB - some themes have them set to do it the way yours does, and other themes have them set to align with the others as if they're just their own main category. it's not that the CSS is "screwing with it" - it's just how the theme designer chose to have them display is all...

    it's in the CSS, yes.
    will i share here? no.
    i don't help people who insult me.
    if you'd like to know, VB - drop me a line. :)

    and now that i know who it is really that called me that... i'm even more upset. i even bought YARN from you! :(

  8. Nah, I know already, but thanks. ;)

  9. wellofdreams
    Member
    Posted 8 years ago #

    LadyDeLuna, if you bought yarn from me, you know me to be a generally friendly person :)
    I do apologise for any offence caused (and I hope that you liked your yarn) - but your initial post wasn't terribly friendly, either :(
    I was having a bad day (which was not your fault) and took offence at the inference that I hadnt bothered to look (which I had). So I apologise.

    Thanks Viperbond, I didnt realise it was a CSS thing - I think I do recall my 'ul' tags being set to not indent; I'll go and change them. Ta :)

Topic Closed

This topic has been closed to new replies.

About this Topic