Support » Everything else WordPress » validator XHTML problem with <p> & <ul>

  • Hello,
    I discover WP, since 3 days. It’s the best blog soft I never know: nice, fast, many plugin, easy to customize…
    I have just a problem with the validator XHTML which I don’t know how to fix, and hope some peoples here can help me to find the solution 🙂
    Here is my validation result
    There are 2 error types:
    1/ document type does not allow element “p” here; missing one of “object”, “applet”, “map”, “iframe”, “button”, “ins”, “del” start-tag
    I don’t have any <p/> in all my blog, so I dont understant where that comme and make error in the blog? 🙁 Are there some thing to change in the templates or main files? I’m using WP

    2/ document type does not allow element “ul” here; missing one of “object”, “applet”, “map”, “iframe”, “button”, “ins”, “del” start-tag
    Do I put something wrong in the “ul” and “li” tag?

    Thank you 🙂

Viewing 4 replies - 1 through 4 (of 4 total)
  • Here’s the rendered source for line 131:

    131: <p><p><a href=""><img src="" alt="Cameron Diaz " /></a><br />

    First off, you have two opening paragraph tags and you don’t seem to close them anywhere. This is probably in your template file since it repeats for each post on the page (look in the loop where it pulls the text for the post).

    The second error is related to the first. You have open paragraph tags and you’re nesting the ul tag inside them. The validator has freaked out because the tags aren’t closed and because ul’s don’t belong inside paragraphs.

    Hope that helps.

    1. In your template(s) see if you have tags surrounding the_content() tag:

    <?php the_content(); ?>

    These are not required (the_content() format post content to include tags automatically), and should be removed.

    2. <ul> tags should not be nested in <span>.

    Thank you Crowspeaker and Kafkaesqui,

    to Crowspeaker: these “p””p”, is not me who create them… you can see my html code of Cameron Diaz post here… That why I supected there are something to change in the template of WP to correct that in my first post.

    to Kafkaesqui:
    – Can u precise where can I find the function the_content() please. I searched in all templates in my themes directory but no result.
    – ” “ul” tags should not be nested in “span”” I thought that too, but when I delete those “span” I dont have less error 🙁 (I had 16 erros before the delete, here is my new validation result)

    I found where the problem, hust because the uncompatible between Markdown and Textile 1 plugin… I’m using now only Markdown and my page is valided 🙂 (there a plugin to remove this uncompatibility, but I don’t use usually Textile so desactivate it is more simple)
    Hope this help someone who have the same prob 🙂
    and welcome to my website 🙂

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘validator XHTML problem with <p> & <ul>’ is closed to new replies.