How to make header image to be clickable with link back to home?

I’d like to make the header image a link back to my homepage. Can you help me with that?

Go to header-extensions.php located in theme folder → library → structure and find line 233.

  • Now see the code from here:

Replace:

<img src="<?php echo esc_url( $header_image ); ?>" class="header-image" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>">

With:

<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
				<img src="<?php echo esc_url( $header_image ); ?>" class="header-image" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>"></a>

Hi Aigars,

I was looking for a way to make my header clickable and found this post. I did as you said, but it still doesn’t work. Is there something I may have missed?

Found it! Was working with a child theme… turns out with the header extensions it wasn’t sucha good idea. But thanks for the code!