Created
May 3, 2017 20:46
-
-
Save jeremyescott/11bd2195320a8836586d03aebe073dd8 to your computer and use it in GitHub Desktop.
Add ID attribute to Genesis HTML5 Markup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://www.itnota.com/adding-id-attribute-genesis-main-content/ | |
// | |
// Adds consideration for high level error reporting | |
// Add id="content" attributes to <main> element | |
add_filter( 'genesis_attr_content', 'my_attr_content' ); | |
function my_attr_content( $attr ) { | |
if( array_key_exists( 'id', $attr ) { | |
$attr['id' .= 'content'; | |
} else { | |
$attr['id'] = 'content'; | |
} | |
return $attr; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment