-
-
Save jasontucker/4504080 to your computer and use it in GitHub Desktop.
Bill's code resulted in having the <span></span> be included in the id="title" which was problematic for the site I as working on my method breaks up the title a bit more to not including the <span></span> in the title attribute.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Set a span around the letters "WP" in Site Title | |
* @author Jason Tucker | |
* Based on code by Bill Erickson | |
* | |
* Why fork? | |
* Bill's code resulted in having the <span></span> | |
* be included in the id="title" which was problematic | |
* for the site I as working on my method breaks up the | |
* title a bit more to not including the <span></span> | |
* in the title attribute. | |
* | |
* @param string $title full title | |
* @param string $inside text | |
* @param string $wrap html wrapper | |
* @return string full title | |
*/ | |
function jt_customize_site_title($title, $inside, $wrap) { | |
$site_title = get_bloginfo( 'name' ); | |
$custom = str_replace('WP', '<span>WP</span>', $site_title); | |
$title = sprintf( '<h1 id="title"><a href="%s" title="%s">%s</a></h1>', trailingslashit( home_url() ), $site_title,$custom); | |
return $title; | |
} | |
add_filter('genesis_seo_title','jt_customize_site_title', 10, 3); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment