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 https://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 https://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