Skip to content

Instantly share code, notes, and snippets.

@anythinggraphic
Last active May 8, 2019 16:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anythinggraphic/0b707f468385431c839aac2af63131fd to your computer and use it in GitHub Desktop.
Save anythinggraphic/0b707f468385431c839aac2af63131fd to your computer and use it in GitHub Desktop.
Change microdata for Article with the class 'entry' in Genesis child themes
<?php
/* @link https://anythinggraphic.net/change-class-id-itemtype-and-other-attributes-in-genesis/
/* Change microdata for Article with the class 'entry' in Genesis child themes
----------------------------------------------------------------------------------------*/
add_filter( 'genesis_attr_entry', 'ag_article_attributes', 20 );
function ag_article_attributes( $attributes ) {
if( is_singular( 'leadership' ) ) {
// class, id, itemscope, itemtype, etc.
$attributes['itemtype'] = 'http://schema.org/Organization';
}
return $attributes;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment