• I’m using WP 2.7 and my custom theme is XHTML 1.0 Strict – or at least I am trying to get it there. It does start there with no XHTML errors at all.

    When I add code to the HTML code editor the code is changed to add extra <p> tags which render the page non-W3C compliant. I edit the code to remove line breaks in the editor and WP 2.7 still adds extra <p> tags. Specifically it adds them after a </table> tag, as well as other places.

    I’m basically chasing my tail here. WP breaks the code and does not allow me to create error-free W3C compliant XHTML 1.0 Strict pages because of the extra <p> tags it inserts.

    It seems to me that in HTML editing mode it would make sense to not add any extra tags, whereas in Visual mode it should add them because that is what Visual mode is all about.

    Is there a solution for this?

    I am doing this for multiple customer sites so this is extremely important to us.

    Thanks for any input to this.

Viewing 6 replies - 1 through 6 (of 6 total)
  • You can avoid many WordPress code problems by making sure that your added custom code is all on one line and by not adding your own paragraph or line break tags (just let WordPress do it).

    Thread Starter RockyMtnHi

    (@rockymtnhi)

    Thanks iridiax.

    I have removed the source code line breaks between the tags where WP places the <p> tags, but it still adds them. I am really perplexed here because that has fixed these problems before, but not now.

    For example, in the code below it inserts a <p> tag between the end table tag and the word When and I can’t do anything to remove it. I even removed the word When and it still adds the extra <p> tag:
    </table>When

    Here’s two code variations to try to see if either make WordPress behave:

    </table><p>When ...</p>

    </table>

    When

    Thread Starter RockyMtnHi

    (@rockymtnhi)

    I did try both of these (just tried again) and everything else that makes sense in terms of outsmarting WP. No workie.

    At this point I’m trying to figure out how to bypass the WP addition of the extranneous <p> tags that consistently break the W3C compliancy.

    Thread Starter RockyMtnHi

    (@rockymtnhi)

    iridiax,
    That was it! I installed the plugin from topic 202980 and it stopped the extra <p> tags from being added by WP.

    Everything we do is standards compliant, and this was killing the page code.

    I truly appreciate your help in solving this problem.

    Happy Holidays to you, and I hope that you receive something during this season that you appreciate as much as I appreciate your guidance here.

    Best regards

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘XHTML 1.o Strict With WP Extra <p> Tags’ is closed to new replies.