Skip to content

Instantly share code, notes, and snippets.

@frankschrijvers
Last active November 17, 2015 19:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frankschrijvers/99a2627dd507897c7b00 to your computer and use it in GitHub Desktop.
Save frankschrijvers/99a2627dd507897c7b00 to your computer and use it in GitHub Desktop.
H1 site title only on the frontpage
<?php
//* Do NOT include the opening PHP tag
//* H1 site title only on the frontpage
add_filter('genesis_seo_title', 'wpstudio_site_title' );
function wpstudio_site_title( $title ) {
$custom_title = get_bloginfo( 'name' );
$tag = ( is_home() || is_front_page() ) ? 'h1' : 'p';
$inside = sprintf( '<a href="%s" title="%s">%s</a>', trailingslashit( home_url() ), esc_attr( get_bloginfo( 'name' ) ), $custom_title );
$title = sprintf ( '<%s class="site-title" itemprop="headline">%s</%s>', $tag, $inside, $tag );
return $title;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment