Created
June 13, 2014 01:27
-
-
Save rfmeier/93f9313c3d7ddf5a49ae to your computer and use it in GitHub Desktop.
Change post/article microdata to Article
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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