Title: Making header image clickable
Last modified: March 23, 2017

---

# Making header image clickable

 *  [maszatjanka](https://wordpress.org/support/users/maszatjanka/)
 * (@maszatjanka)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/making-header-image-clickable-2/)
 * Hi, I would like to have the header redirect to the home page from anywhere on
   the website. I have been trying everything written on the forums, including inserting
   a “a href…” tag in the custom header.php, which shut the whole site down, including
   the admin platform (HTTP 500). It seems like a pretty basic feature, still I 
   can’t manage it anyhow…
 * Any ideas (which don’t make my site collapse again)?
 * My site is rhbaba.hu, and I use the Sela theme.
 * Thanks!

Viewing 1 replies (of 1 total)

 *  [Chad Chadbourne](https://wordpress.org/support/users/shireling/)
 * (@shireling)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/making-header-image-clickable-2/#post-8949163)
 * Hi [@maszatjanka](https://wordpress.org/support/users/maszatjanka/)!
 * Definitely doable 🙂 We’ll want to remove the current text link, since that one
   will be effectively replaced by the new link you’re adding. First, make sure 
   you have a [child theme](https://codex.wordpress.org/Child_Themes) ready to work
   in so these changes are safe during future theme updates.
 * Next, make a copy of the parent theme’s `header.php` file in your child theme
   folder.
 * In that file, you’ll see a line like this:
 * `<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title
   ="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?
   php bloginfo( 'name' ); ?></a></h1>`
 * That creates a link to the home page of the site, using the site title. We’ll
   need to trim that down a bit to just this:
 * `<h1 class="site-title"><?php bloginfo( 'name' ); ?></h1>`
 * Now we’re displaying the title, but not as a link.
 * Next, we add our own link! A few lines up from where were just working you’ll
   see the beginning of the `.site-branding` block:
 * `<div class="site-branding">`
 * Add a new line just below that. On that line, paste the following:
 * `<a class="header-link" href="<?php echo esc_url( home_url( '/' ) ); ?>" title
   ="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"></
   a>`
 * This recreates the original link, but as an empty box instead of text. We’ll 
   use CSS to give it the size, shape, and position it needs:
 *     ```
       .site-branding {
           position: relative;
       }
   
       .header-link {
           width: 100%;
           height: 100%;
           position: absolute;
           top: 0;
           left: 0;
           z-index: 1;
       }
       ```
   
 * That should do the trick! Let me know how it goes

Viewing 1 replies (of 1 total)

The topic ‘Making header image clickable’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/sela/1.0.17/screenshot.png)
 * Sela
 * [Support Threads](https://wordpress.org/support/theme/sela/)
 * [Active Topics](https://wordpress.org/support/theme/sela/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/sela/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/sela/reviews/)

## Tags

 * [header](https://wordpress.org/support/topic-tag/header/)
 * [home](https://wordpress.org/support/topic-tag/home/)
 * [redirect](https://wordpress.org/support/topic-tag/redirect/)

 * 1 reply
 * 2 participants
 * Last reply from: [Chad Chadbourne](https://wordpress.org/support/users/shireling/)
 * Last activity: [9 years, 3 months ago](https://wordpress.org/support/topic/making-header-image-clickable-2/#post-8949163)
 * Status: not resolved