follow mejoin mesubscribe

Change the Genesis Header Home Link

While I generally wouldn’t recommend linking to an external site from your header, on occasion, you may need to change the URL of the header home link. For example, if you have set up your WordPress install in a subdirectory as a secondary area of an already existing site, you may want the header URL to direct users back to your site’s main homepage. Changing it is simple.

Place the following filter in your Genesis Child Theme functions.php.

add_filter( 'genesis_seo_title', 'child_header_title', 10, 3 );
/**
 * Change default Header URL.
 * 
 * @author Jen Baumann
 * @link http://dreamwhisperdesigns.com/genesis-tutorials/change-genesis-header-home-link/
 * 
 */
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 id="title">%2$s</%1$s>', $wrap, $inside );
}

For HTML5 themes, place the following filter in your Genesis Child Theme functions.php:

add_filter( 'genesis_seo_title', 'child_header_title', 10, 3 );
/**
 * Change default Header URL.
 * 
 * @author Jen Baumann
 * @link http://dreamwhisperdesigns.com/genesis-tutorials/change-genesis-header-home-link/
 */
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 );
}

Remember to update the example.com value to your own.
Last updated: January 9, 2014 at 10:13 am

About Jennifer Baumann

I am an avid horseback rider, animal lover, and freelance designer. I love working with WordPress and Genesis and work for Copyblogger Media as a Technical Support Advocate.

Dream Whisper Designs is Powered by Genesis

StudioPress Premium WordPress Themes

Genesis empowers you to quickly and easily build incredible websites with WordPress. Whether you're a novice or advanced developer, Genesis provides the secure and search-engine-optimized foundation that takes WordPress to places you never thought it could go. It's that simple - start using Genesis now!

Take advantage of the 6 default layout options, comprehensive SEO settings, rock-solid security, flexible theme options, cool custom widgets, custom design hooks, and a huge selection of child themes ("skins") that make your site look the way you want it to. With automatic theme updates and world-class support included, Genesis is the smart choice for your WordPress website or blog.