Support » Fixing WordPress » wp_list_cats woes

  • D-xiansheng


    I’m having major trouble with wp_list_cats. I have the following categories (number at left is ID, – indicates child):

    30 Blog
    – 1 General
    – 2 Jargon
    – 27 Rants
    – 31 Tea
    3 Ticker
    – 9 Der Langrisser
    – 25 FEIDIAN
    – 10 Heroine Anthem
    – 11 Heroine Anthem II
    – 12 Legend of the Swordsman & Fairy
    – 26 NINJA
    – 24 Obsoleted

    I want it to appear as a list with the children indented, but unless I set hierarchical=0, NOTHING AT ALL appears. I thought maybe it was due to no posts in the parent categories, but after adding posts, that turned out to be false.

    What string should I be using? An empty string or sort_column=name does nothing, and sort_column=name&hierarchical=0 makes a big ugly un-indented list that mixes all the children together.

    I am using WordPress 1.5.2

Viewing 1 replies (of 1 total)
  • From the Codex article on wp_list_cats, I’d say you’d want:
    <?php wp_list_cats('children=1&hierarchical=1&hide_empty=0'); ?>.

    This string should display your list of categories with the children categories indented and all categories will be displayed (regardless of whether there are posts in the categories).

Viewing 1 replies (of 1 total)
  • The topic ‘wp_list_cats woes’ is closed to new replies.