Skip to content

Instantly share code, notes, and snippets.

@rickrduncan
Last active May 15, 2017 08:05
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rickrduncan/6261200 to your computer and use it in GitHub Desktop.
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.
<?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