Dynamic Genesis H1 Site Title Markup

The Site Title should only be wrapped in an H1 tag on the home page. Otherwise you’ll have two H1s on every page and post on your site.

Modify The Title Markup Site Wide

1
2
3
4
5
6
7
8
9
10
11
/* Remove Default Site Title and Description because they have H1 and H2 tags */
/* Add back title and description with other tags to avoid duplicate H1s and H2s.*/
 
remove_action( 'genesis_site_title', 'genesis_seo_site_title' );
remove_action( 'genesis_site_description', 'genesis_seo_site_description' );
add_action( 'genesis_site_title', 'child_seo_site_title' );
 
 
function child_seo_site_title() { 
 	echo '<span class="about-me"><span class="name"><a href="/" title="Home">Chris Bryant</a></span><span class="divider">&#47;</span>Web Design &#43; Digital Strategy for Business</span>';
 }

Change the Homepage to H1 but modify the title everywhere else.

1
2
3
4
5
6
7
8
9
10
11
/*
//Dynamic Site Title Class - haven't tested this completely
add_action( 'genesis_site_title', 'em_dynamic_site_title' );
function em_dynamic_site_title() {
	if(is_home() || is_front_page()) { ?> 
		<h1 id="site-title"><a href="/" title="Home"><?php bloginfo('name');?></a></h1>
	<?php } else { ?>
		<span id="site-title"><a href="/" title="Home"><?php bloginfo('name');?></a></span>
	<?php }
}
*/