Ever gotten something like: Line 61, Column 56: document type does not allow element "div" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag when you validate your code? This is because by default, WordPress automatically inserts paragraph tags all over the place when displaying ‘the_content’ creating validation issues (inserting implicit <p>). If you want to strip the automatically inserted paragraph tags from your content, simply insert this line in your template file above ‘the_content’ tag:
[php]<?php remove_filter (‘the_content’, ‘wpautop’); ?>[/php]
Another method, if you prefer not to use this one is to insert </p> before <div> or shortcodes like [nggallery id=x]. This will help your pages validate correctly.
Leave a Reply