Unless otherwise indicated, the code snippets you see below should be placed into your theme’s functions.php file.
Here is the code needed to modify the header URL of your site with a Genesis HTML5 Child Theme:
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Modify the header URL - HTML5 Version
add_filter( 'genesis_seo_title', 'child_header_title', 10, 3 );
function child_header_title( $title, $inside, $wrap ) {
$inside = sprintf( '<a href="http://example.com/" title="%s">%s</a>', esc_attr( get_bloginfo( 'name' ) ), get_bloginfo( 'name' ) );
return sprintf( '<%1$s class="site-title">%2$s</%1$s>', $wrap, $inside );
}
Here is the code needed to modify the header URL of your site with an XHTML Child Theme:
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Modify the header URL - XHTML Version
add_filter('genesis_seo_title', 'sp_seo_title', 10, 3);
function sp_seo_title($title, $inside, $wrap) {
$inside = sprintf( '<a href="http://www.yourdomain.com" title="%s">%s</a>', esc_attr( get_bloginfo('name') ), get_bloginfo('name') );
$title = sprintf('<%s id="title">%s</%s>', $wrap, $inside, $wrap);
return $title;
}
Here is the code needed to modify the header URL of your site when using a logo image:
add_filter( 'get_custom_logo', 'sp_custom_logo_link' );
function sp_custom_logo_link( $html ) {
return str_replace( 'href="http://yourdomain.com', 'href="http://example.com', $html );
}
Replace http://yourdomain.com with your current website URL, and replace http://example.com with the desired URL that the logo should link to.