Last active
May 15, 2017 08:05
-
-
Save rickrduncan/6261200 to your computer and use it in GitHub Desktop.
Filter the Genesis 2.0 SEO title to remove the H1 tag and implement the Organization/Logo schema.
This file contains hidden or 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 | |
//* Add Organization schema to our logo | |
//* Note that logo location is not inside WordPress. It's in a folder named 'img' off of the root of website. | |
add_filter( 'genesis_seo_title', 'b3m_header_title', 10, 3 ); | |
function b3m_header_title( $title, $inside, $wrap ) { | |
$inside = sprintf( '<div itemscope="itemscope" itemtype="http://schema.org/Organization"><a itemprop="url" href="%s" title="%s"><img class="logo" itemprop="logo" src="http://www.YOUR-DOMAIN.com/img/YOUR-LOGO.png" alt="%s" /></a></div>', trailingslashit( home_url() ), esc_attr( get_bloginfo( 'name' ) ), get_bloginfo( 'name' ) ); | |
return sprintf( '<%1$s id="title">%2$s</%1$s>', 'span', $inside ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment