Skip to content

Christopher James Willcock

Enjoy Kaizen

HTML5 Support in WordPress

WordPress has a feature to enable HTML5 support which doesn’t cover all the places where HTML5 support is needed.

add_theme_support('html5', array(
  'search-form',
  'comment-form',
  'comment-list',
  'gallery',
  'caption',
));

This is everything available ^^^. When adding inline styles to the HTML, which WordPress does automatically, there is no filter hook available to remove the type attribute from the style tags. We end up with this incorrect output:

<style type="text/css">…</style>

Allowing this to stay there won’t break anything, it’s very insignificant overall. However, my practice includes the method of no broken windows. Allowing this to stay, though it’s really out of my hands unless I abandon WordPress entirely, is anathema to me.

It’s important to experience the pain of a program done wrong, before we can appreciate the well-made version of the same. There isn’t time to fix everything and still get the job done. Eventually it’s time to directly address the cause, but not today.

Leave a Reply

Your email address will not be published. Required fields are marked *