Ready to get started?Download WordPress


Show hierarchy in category listing? (6 posts)

  1. larrystein
    Posted 9 years ago #


    What I'm trying to do is make the wp_list_cats function indicate which categories have "parents" by making a list with bullets and sub-bullets.

    Example: http://www.thenonist.com (click on the categories button in the left hand sidebar)

    In other words, I want my category list to look like this.

    • Parent category 1
      • Sub-category (under PC 1)
    • Parent category 2

    I have templates installed in which this hierarchy occurs, but I don't see any special parameters in the code that would order such a thing to happen.



  2. Lorelle
    Posted 9 years ago #

    http://codex.wordpress.org/Template_Tags/wp_list_cats is the page that highlights the various parameters for this tag.

    According to that page:

    <?php wp_list_cats(); ?>

    defaults to:

    * children - Shows the children (sub-categories) of every category listed
    * hierarchical - Displays the children categories in a hierarchical order under its category parent

  3. larrystein
    Posted 9 years ago #

    Actually, I already tried that, it doesn't seem to work.

  4. moshu
    Posted 9 years ago #

    You have to style them in your style.css.
    #nav ul ul ul.children {...

    #nav ul ul ul li{...

    Apply the idea creatively :)

  5. donpaolo
    Posted 9 years ago #

    I did't understand last explanation. Could you explain better?

    I modified the template, what must I modify too? style.css? How?

    Thank you!

  6. moshu
    Posted 9 years ago #

    Try this Codex page: http://codex.wordpress.org/Styling_Lists_with_CSS
    and also the references given at the bottom of the page.

Topic Closed

This topic has been closed to new replies.

About this Topic