Support » Themes and Templates » Indenting Subcategories

  • I am having a difficult time trying to get my subcategories to indent as children under their parent category. Here is my current sidebar code:

    <?php list_cats(FALSE, ”, ‘order’,
    ‘asc’, ”, TRUE, FALSE,
    FALSE, FALSE, FALSE,
    FALSE, FALSE, ”, FALSE,
    ”, ”, ‘1,33’,
    FALSE); ?>

    And here is my CSS code:

    #sidebar ul li.children {
    line-height: 1.5em;
    list-style-type: none;
    margin-left: 10px;
    }

    Are either of these code strings configured improperly or am I looking in the wrong place?

    Any help would be greatly appreciated.

Viewing 4 replies - 1 through 4 (of 4 total)
  • WIthout seeing more code, I don’t know if this’ll work. but off the top of my head, I’d say to change “margin-left:10px” to “padding-left:10px;”

    But if that diesn’t work, seeing all the code (or a link to the page) would be very helpful.

    I’m looking for the same answer, trying this page now:

    http://wordpress.org/support/topic/25173

    ETA: I got it working! The codex lies about the default value of the hierarchical tag, but I had to add some other things to get what I wanted. I have a line within sidebar.php that reads:

    <?php wp_list_cats('sort_column=name&optioncount=1&hide_empty=0&children=1&hierarchical=1') ?>

    ETA Again: Here is the codex with the tags, http://codex.wordpress.org/Template_Tags/list_cats

    Julie, that’s an old thread… since then WP was updated several times and the bug fixed.
    It is very simple. You have to style nested lists. Plus, WP assignes special class (children) to the subcats. So, just define them in the stylesheet.
    (and unless you need some special display, you don’t need all those parameters in the template tag)

    Oh well, so much for doing my good deed for today, though I didn’t do a darn thing with nested style lists to get it working.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Indenting Subcategories’ is closed to new replies.