Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Add ID attribute to Genesis HTML5 Markup
// 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