Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Use the AboutPage microdata schema for your About page with Genesis 2.0
<?php
//* do not include php tag
add_filter( 'genesis_attr_body', 'about_page_body_schema' );
/**
* Callback for Genesis 'genesis_attr_body' filter.
*
* Use the AboutPage microdata schema for the About page.
*
* @package Genesis
* @category Attributes
* @author Ryan Meier http://www.rfmeier.net/
*
* @param array $attributes The array of attributes
* @return array $attributes The array of attributes
*/
function about_page_body_schema( $attributes ) {
// if About page, use the AboutPage schema
if ( is_page( 'about' ) ) {
$attributes['itemtype'] = 'http://schema.org/AboutPage';
}
// if Services page, use the ContactPage schema
if ( is_page( 'services' ) ) {
$attributes['itemtype'] = 'http://schema.org/ContactPage';
}
return $attributes;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.