digisavvy
11/5/2014 - 5:45 PM

Genesis SIte Title Text Filter

Genesis SIte Title Text Filter

// Filter the title with a custom function
add_filter('genesis_seo_title', 'gmugeo_site_title' );

// Add additional custom style to site header
function gmugeo_site_title( $title ) {

    	// Change $custom_title text as you wish
	$custom_title = '<span class="custom-title">Custom Title Text';


	// If we're on the front page or home page, use `h1` heading, otherwise us a `p` tag
	$tag = ( is_home() || is_front_page() ) ? 'h1' : 'p';

	// Compose link with title
	$inside = sprintf( '<a href="%s" title="Your Title Text Here">%s</a>', trailingslashit( home_url() ), esc_attr( get_bloginfo( 'name' ) ), $custom_title );

	// Wrap link and title in semantic markup
	$title = sprintf ( '<%s class="site-title" itemprop="headline">%s</%s>', $tag, $inside, $tag );
	return $title;

}