Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
H1 site title only on the frontpage
//* 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