Created
July 23, 2015 05:55
-
-
Save jainnidhi/f155ee9ba54a3a8d699b to your computer and use it in GitHub Desktop.
genesis logo code
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
add_filter('genesis_seo_title', 'custom_header_inline_logo', 10, 3); | |
function custom_header_inline_logo($title, $inside, $wrap) { | |
$logo = '<img src="' . get_stylesheet_directory_uri() . '/images/ib-logo_360.png" alt="' . esc_attr(get_bloginfo('name')) . '" title="' . esc_attr(get_bloginfo('name')) . '" width="300" height="60" />'; | |
$inside = sprintf('<a href="%s" title="%s">%s</a>', trailingslashit(home_url()), esc_attr(get_bloginfo('name')), $logo); | |
// Determine which wrapping tags to use - changed is_home to is_front_page to fix Genesis bug | |
$wrap = is_front_page() && 'title' === genesis_get_seo_option('home_h1_on') ? 'h1' : 'p'; | |
// A little fallback, in case an SEO plugin is active - changed is_home to is_front_page to fix Genesis bug | |
$wrap = is_front_page() && !genesis_get_seo_option('home_h1_on') ? 'h1' : $wrap; | |
// And finally, $wrap in h1 if HTML5 & semantic headings enabled | |
$wrap = genesis_html5() && genesis_get_seo_option('semantic_headings') ? 'h1' : $wrap; | |
return sprintf('<%1$s %2$s>%3$s</%1$s>', $wrap, genesis_attr('site-title'), $inside); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment