Last active
December 25, 2015 10:48
-
-
Save rickrduncan/6963824 to your computer and use it in GitHub Desktop.
Genesis 2.0 - Filter schema attributes for body element.
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 | |
//* Do NOT include the opening php tag | |
//* Change microdata schema when on the About or Contact page. | |
//* http://schema.org/docs/documents.html | |
//* genesis/lib/functions/markup.php | |
add_filter( 'genesis_attr_body', 'rvam_body_schema' ); | |
function rvam_body_schema( $attributes ){ | |
//* Use AboutPage schema on our about page | |
if( is_page( array( 'about', 1727 ) ) ) { | |
$attributes['itemtype'] = 'http://schema.org/AboutPage'; | |
} | |
//* Use ContactPage schema on our contact page | |
if( is_page( 'contact' ) ) { | |
$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