Title: get_header();
Last modified: August 22, 2016

---

# get_header();

 *  Resolved [billy1983](https://wordpress.org/support/users/billy1983/)
 * (@billy1983)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/get_header-3/)
 * Hi,
    i am trying to make the header image only display on the homepage. so what
   i have done is to create a duplicate the header.php file and i have created a
   new template also. what i am struggling with is the get_header(); function call
   at the top of the php page. can someone tell me what javascript file the get_header()
   function is in so i can duplicate it. or tell me how i can do it another way.
   Many thanks Billy

Viewing 3 replies - 1 through 3 (of 3 total)

 *  anonymized-13749270
 * (@anonymized-13749270)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/get_header-3/#post-5179780)
 * use names, and call the homepage header using it’s name :
    `get_header( $name);`
   read about it in [codex](http://codex.wordpress.org/Function_Reference/get_header)
   i tried to apply it but unfortunately my theme does not support custom headers..
 *  [linux4me2](https://wordpress.org/support/users/linux4me2/)
 * (@linux4me2)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/get_header-3/#post-5180091)
 * It sounds like you already created a child theme? If so, just copy the header.
   php from the parent theme’s folder to your child theme’s folder.
 * Find this code in the header.php file:
 *     ```
       <div class="header-image">
       	<?php $header_image = get_header_image();
       		if ( ! empty( $header_image ) ) { ?>
       			<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
       				<img src="<?php header_image(); ?>" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="" />
       			</a>
       		<?php } // if ( ! empty( $header_image ) ) ?>
       	</div>
       ```
   
 * and replace it with:
 *     ```
       <div class="header-image">
       	<?php
       		if (is_front_page()) {
       			$header_image = get_header_image();
       			if ( ! empty( $header_image ) ) {
       			?>
       				<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
       					<img src="<?php header_image(); ?>" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="" />
       				</a>
       			<?php
       			}
       		}
       	?>
       	</div>
       ```
   
 * You don’t need to worry about the get_header() function. It’s not involved with
   the header image.
 *  Theme Author [Template Express](https://wordpress.org/support/users/danstriker/)
 * (@danstriker)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/get_header-3/#post-5180117)
 * thanks linux that should indeed do the trick

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘get_header();’ is closed to new replies.

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

## Tags

 * [get_header](https://wordpress.org/support/topic-tag/get_header/)
 * [header](https://wordpress.org/support/topic-tag/header/)
 * [javascript](https://wordpress.org/support/topic-tag/javascript/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [templates](https://wordpress.org/support/topic-tag/templates/)

 * 3 replies
 * 4 participants
 * Last reply from: [Template Express](https://wordpress.org/support/users/danstriker/)
 * Last activity: [11 years, 8 months ago](https://wordpress.org/support/topic/get_header-3/#post-5180117)
 * Status: resolved