WordPress.org

Ready to get started?Download WordPress

Forums

Nested List Problem (7 posts)

  1. ptvguy
    Member
    Posted 5 years ago #

    Anyone else having a problem with nested lists? I'm using WP 2.6.2 with the visual editor turned off. I want to create a post using a nested list along the lines of the following code:

    <ul>
    <li>
    x
    </li>
    <li>
    y
    <ul>
    <li>
    z
    </li>
    </ul>
    </li>
    </ul>

    Unfortunately, when I save my post, WP adds a closing paragraph tag to the code like this:

    <ul>
    <li>
    x
    </li>
    <li>
    y</p>
    <ul>
    <li>
    z
    </li>
    </ul>
    </li>
    </ul>

    Is there a fix for that?

  2. ptvguy
    Member
    Posted 5 years ago #

    Oops, I forgot to mention that I have the "WordPress should correct invalidly nested XHTML automatically" option unchecked.

  3. EMG
    Forum Volunteer
    Posted 5 years ago #

    This is an eight month old topic, but I'm going to revive it because even now with 2.8, the nested lists problem that won't validate still perpetuates, especially if you have multiple paragraphs of text in your list.

    Thankfully, this only happened in a page post and so I just implemented my correctly nested list without additional incorrect tags into a template and used the template for my page post instead of writing an actual post and then used CSS to display: none the post that's nonexistent.

    ... What a convoluted workaround.

  4. ptvguy
    Member
    Posted 5 years ago #

    I don't have that problem anymore since 2.7.1. No sign of it in 2.8 either, but I have "WordPress should correct invalidly nested XHTML automatically" turned off now.

  5. ArcherTC
    Member
    Posted 4 years ago #

    I thought I was going crazy: checked and rechecked my code, fed it through Dreamweaver CS3, and then gave up to go searching for reports of a problem. Here to report that this problem still exists for 2.8.4, at least for nesting an unordered list within an ordered one.

  6. ArcherTC
    Member
    Posted 4 years ago #

    I should note: this looks fine in the "visual" view of the page, but is messed up on the published page. Possible clues to a fix would be very welcome!

  7. Mark / t31os
    Moderator
    Posted 4 years ago #

    I can't replicate that problem on 2.8.4...

    If you're using HTML in the post, paste it in under the HTML tab.

    Maybe you have other invalid markup in the page that WordPress is trying to account for..

Topic Closed

This topic has been closed to new replies.

About this Topic