Support » Themes and Templates » wp_list_categories output

  • I’m hoping someone can please shed some light on this for me. I’ve been up and down the forums but can’t find anything that really explains this.

    Why does:
    <?php wp_list_categories('title_li=<h2>' . __('Categories') . '</h2>&echo=0' ) ?>

    output:

    <li class="categories">
    <h2>Categories</h2>
    <ul>
    <li>Item 1</li>
    <li>Item 2</li>
    </ul></li>

    Instead of:

    <h2>Categories</h2>
    <ul>
    <li>Item 1</li>
    <li>Item 2</li>
    </ul>

    ?
    And a better question, how does one get it to behave properly? I’d imagine something like this would be what I’m looking for, but I don’t know how to tweak it to call categories instead of pages.

    Thanks for any input.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Try this perhaps…

    <h2>Categories</h2>
    <ul>
    <?php wp_list_categories('title_li='); ?>
    </ul>

    Understandable, but I don’t understand why if there is the title tag, does it nest it improperly like that. I mean, am I the only one that thinks so?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘wp_list_categories output’ is closed to new replies.