Skip to content

Instantly share code, notes, and snippets.

@davechu
Created September 9, 2015 19:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davechu/db6f309519ee91619f10 to your computer and use it in GitHub Desktop.
Save davechu/db6f309519ee91619f10 to your computer and use it in GitHub Desktop.
The idea is to use the genesis_attr_{some-class-or-html-tag} format. Your class (or HTML tag) must only occur once on the page for it to work. Notice that I concatenate the class so that existing classes don't get lost.
add_filter( 'genesis_attr_site-inner', 'dc_modify_site_inner_attr' );
function dc_modify_site_inner_attr( $attributes ) {
$attributes['itemtype'] = 'http://schema.org/Report';
$attributes['class'] .= ' myNewClass';
return $attributes;
}
add_filter( 'genesis_attr_head', 'dc_modify_head_attr' );
function dc_modify_head_attr( $attributes ) {
$attributes['itemtype'] = 'http://schema.org/Report';
$attributes['class'] .= ' myNewClass';
return $attributes;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment