Created
April 15, 2013 21:42
-
-
Save pdewouters/5391496 to your computer and use it in GitHub Desktop.
use an image for the logo in genesis child theme
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
/** | |
* Use an img tag for the logo | |
* @param $title | |
* @param $inside | |
* @param $wrap | |
* | |
* @return string | |
*/ | |
function ssm_modify_site_title_html( $title, $inside, $wrap ) { | |
$wrap = ( is_home() || is_front_page() || is_archive() ) && !is_post_type_archive('product') && 'title' == genesis_get_seo_option( 'home_h1_on' ) ? 'h1' : 'p'; | |
/** Set what goes inside the wrapping tags */ | |
$inside = sprintf( '<a href="%s"><img width="259" height="84" src="%s" alt="%s" /></a>', trailingslashit( home_url() ), get_stylesheet_directory_uri() . '/images/logo.png', get_bloginfo( 'name' ) ); | |
/** Build the Title */ | |
$title = sprintf( '<%s id="title">%s</%s>', $wrap, $inside, $wrap ); | |
return $title; | |
} | |
add_filter( 'genesis_seo_title', 'ssm_modify_site_title_html', 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment