Created
July 17, 2013 13:39
-
-
Save JiveDig/6020630 to your computer and use it in GitHub Desktop.
Replace site title with an inline logo in Genesis 2.0 with HTML5
This file contains hidden or 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
// Requires Genesis 2.0 with HTML5 | |
// Replace site title with an inline logo | |
remove_action( 'genesis_site_title', 'genesis_seo_site_title' ); | |
add_action( 'genesis_site_title', 'child_do_logo' ); | |
function child_do_logo() { | |
$site_url = site_url(); | |
$blog_title = get_bloginfo(); | |
if( is_front_page() OR is_home() ) { | |
echo '<h1 class="site-title" itemprop="name">'; | |
echo '<meta itemprop="logo" content="' . $site_url . '/wp-content/images/logo.png">'; | |
echo '<a itemprop="url" href="' . $site_url . '" title="' . $blog_title . '">' . $blog_title . '</a>'; | |
echo '</h1>'; | |
} else { | |
echo '<p class="site-title" itemprop="name">'; | |
echo '<meta itemprop="logo" content="' . $site_url . '/wp-content/images/logo.png">'; | |
echo '<a itemprop="url" href="' . $site_url . '" title="' . $blog_title . '">' . $blog_title . '</a>'; | |
echo '</p>'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment