Skip to content

Instantly share code, notes, and snippets.

@mattbanks
Last active December 21, 2015 07:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mattbanks/6269841 to your computer and use it in GitHub Desktop.
Save mattbanks/6269841 to your computer and use it in GitHub Desktop.
Adding Conditional Classes to the HTML Tag in Genesis 2.0
/**
* HTML5 DOCTYPE
* removes the default Genesis doctype, adds new html5 doctype with IE8 detection
*/
function mb_html5_doctype() {
?>
<!DOCTYPE html>
<!--[if IE 8]> <html class="lt-ie9" <?php language_attributes( 'html' ); ?>> <![endif]-->
<!--[if gt IE 8]><!--> <html <?php language_attributes( 'html' ); ?>> <!--<![endif]-->
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<?php
}
remove_action( 'genesis_doctype', 'genesis_do_doctype' );
add_action( 'genesis_doctype', 'mb_html5_doctype' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment