Skip to content

Instantly share code, notes, and snippets.

@MaruscaGabriel
Created March 9, 2015 18:19
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 MaruscaGabriel/15ce3fdfbf72161ffc0d to your computer and use it in GitHub Desktop.
Save MaruscaGabriel/15ce3fdfbf72161ffc0d to your computer and use it in GitHub Desktop.
Remove Schema.org markup wraping Genesis
add_filter( 'genesis_attr_entry', 'prefix_attributes_entry_content', 15 );
function prefix_attributes_entry_content( $attributes ) {
unset( $attributes['class'] );
unset( $attributes['itemprop'] );
unset( $attributes['itemtype'] );
unset( $attributes['itemscope'] );
//* Blog posts microdata
if ( 'post' === get_post_type() ) {
$attributes['class'] = join( ' ', get_post_class() );
$attributes['itemtype'] = 'http://schema.org/BlogPosting';
//* If main query,
if ( is_main_query() )
$attributes['itemprop'] = 'blogPost';
}
return $attributes;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment