Skip to content

Instantly share code, notes, and snippets.

@rfmeier
Created June 13, 2014 01:27
Show Gist options
  • Save rfmeier/93f9313c3d7ddf5a49ae to your computer and use it in GitHub Desktop.
Save rfmeier/93f9313c3d7ddf5a49ae to your computer and use it in GitHub Desktop.
Change post/article microdata to Article
<?php
// functions.php
add_filter( 'genesis_attr_entry', 'custom_genesis_attr_entry' );
/**
* Callback for Genesis 'genesis_attr_entry' filter.
*
* Change the current entry's 'itemprop' and 'itemtype' attributes to
* use the Article microdata schema from BlogPosting.
*
* @package Genesis 2.0
* @category Markup
* @author Ryan Meier http://www.rfmeier.net/
*
* @global $post $post The current post object
* @param array $attributes Array of attributes
* @return array $attributes Array of attributes
*/
function custom_genesis_attr_entry( $attributes ){
// change itemprop attribute
$attributes['itemprop'] = 'articleBody';
// change itemtype attribute
$attributes['itemtype'] = 'http://schema.org/Article';
// return the attributes
return $attributes;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment