html5

HTML5 for wordpress

The following code has HTML5 replacements for the doctype, and other elements for WordPress themes. Add this code to your header.php file and you site will use HTML5.


<!DOCTYPE HTML>
<html <?php language_attributes(); ?>>
<head>

<meta charset="<?php bloginfo('charset'); ?>" />

<!--[if lt IE 9]>
<script type="text/javascript" src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

<style type="text/css">
/* HTML5-specific CSS setup */
article,aside,figure,footer,header,hgroup,nav,section { display:block; }
</style>

For internet explorer compatibility it will include the html5shiv this code will recognize and style the HTML5 elements in internet explorer prior to version 9.

Please backup(!) and check your theme carefully before deploying.

Leave a Reply