The Pilcrow

A WordPress developer's thoughts on professional and personal development. Written by Karin Taliga

A plugin for making Thematic use html5 elements

Update Mar 2nd 2013: Version 0.4 (24.11.2014) adds the boilerplate conditional classes as well as a shiv for older browsers. This information is now obsolete. Check out what’s new and download the latest release on the plugin page

Update Aug 19th 2012: Added filter for closing the conditional. Thanks Scott for the heads up!

Since there is no decision made at Writing the time of this writing on how or when Thematic will move to html5, I wrote a plugin that will switch the markup for you in the meantime.

At the moment thats all it does. There are no options or settings, just upload it, activate it and go. It does not add any javascript for older browser support so you will need to take care of that in your child theme.

Also, cheap mlb jerseys version 0.2 does not use the html5 boilerplate doctype with conditional IE classes. I thought it made no sense to put in a “no-js” class when the plugin cannot be git sure that the child theme are swapping them with javascript. If you want to use modernizr, you might also want to use the html5 boilerplate.

You can put this in your child theme’s functions.php, Sopas note the priority on the filter.

function childtheme_create_doctype() {
      $content = '<!doctype html>' . "n";
      $content .= '<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" dir="' . get_bloginfo ('text_direction') . '" lang="'. get_bloginfo ('language') . '"> <![endif]-->' . "n";
      $content .=  wholesale nfl jerseys  '<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" dir="' . get_bloginfo ('text_direction') . '" lang="'. get_bloginfo ('language') . '"> <![endif]-->'. "n";
      $content .= '<!--[if IE 8]> <html class="no-js lt-ie9" dir="' . get_bloginfo ('text_direction')  with  . '" lang="'. get_bloginfo ('language') . '"> <![endif]-->' . "n";
      $content .= '<!--[if gt IE 8]><!-->'  Lititz  . "n";
      $content .= '<html class="no-js"';
      return $content; 
} 
add_filter('thematic_create_doctype', 'childtheme_create_doctype', 11);

You would also need to close the last IE conditional using

function childtheme_close_conditional( $content ) {
  wholesale nba jerseys     return '<!--<![endif]-->' . "n" . $content ;
}
add_filter( 'thematic_head_profile', 'childtheme_close_conditional', 11);

Are you missing something? Found a bug? Create an issue at the thematic-html5 github issue tracker. Or fork it on github and add you contribution!

Download

Download thematic-html5 from the official wordpress directory.

Next Post

Previous Post

© 2017 The Pilcrow

Theme by Anders Norén