HTML5 header.php WordPress Theme Modifications

/ Published in: PHP
Save to your folder(s)

HTML5 replacements for the doctype, etc. for WorPress themes. Add this code to your header.php file and you site will use HTML5. Be sure to double check the rest of your theme files for validation errors.

Copy this code and paste it in your HTML
  2. <html <?php language_attributes(); ?>>
  3. <head>
  4. <meta charset="<?php bloginfo('charset'); ?>" />
  5. <!--[if lt IE 9]>
  6. <script type="text/javascript" src=""></script>
  7. <![endif]-->
  8. <style type="text/css">
  9. /* HTML5-specific CSS setup */
  10. article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { display:block }
  11. </style>

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.