Title: Different headers coding.
Last modified: August 20, 2016

---

# Different headers coding.

 *  [techbunny](https://wordpress.org/support/users/techbunny/)
 * (@techbunny)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/different-headers-coding/)
 * Hi guy’s,
 * I’ve been trying to develop a wordpress template to use different header images
   on each page. I have found several closed topics which have been helpful but 
   I’m at a sticking point where I think the code is correct but the images are 
   not displaying.
 * The topic I have used for reference is: [http://wordpress.org/support/topic/different-headers-for-each-page](http://wordpress.org/support/topic/different-headers-for-each-page)
 * The coding I have placed into my **Main Index Template.php** is:
 *     ```
       get_header(); ?>
   
       <?php if (is_home()) get_header(); ?>
       <?php if (is_page(wh-casino()) include(get_template_directory() . 'http://techbunny.net/wp-content/uploads/2012/12/Sturgeons-078.jpeg'); ?>
       ```
   
 * I’m wondering if using the page name (wh-casino) or the image url is what’s causing
   the code to fail, please can someone point me in the right direction?
 * Thanks 🙂

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

 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [13 years, 5 months ago](https://wordpress.org/support/topic/different-headers-coding/#post-3246729)
 * This is generating an invalid URL
 *     ```
       include(get_template_directory() . '<em>http://techbunny.net/wp-content/uploads/2012/12/Sturgeons-078.jpeg</em>');
       ```
   
 * It’s outputting something like this
 *     ```
       /wp-content/themes/yourThemeName/http://techbunny.net/wp-content/uploads/2012/12/Sturgeons-078.jpeg
       ```
   
 * Perhaps you just want either this;
 *     ```
       include(get_template_directory() . 'uploads/2012/12/Sturgeons-078.jpeg');
       ```
   
 * Or
 *     ```
       include('http://techbunny.net/wp-content/uploads/2012/12/Sturgeons-078.jpeg');
       ```
   
 * You shouldn’t have HTML elements in `include` functions.
 *  Thread Starter [techbunny](https://wordpress.org/support/users/techbunny/)
 * (@techbunny)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/different-headers-coding/#post-3246730)
 * Hi Andrew,
 * I was literally just editing my post because the italics tags were to highlight
   the two areas I think were causing problems but they are not present in my code.
 * I will try your suggestions, thank you for a fast response 🙂
 * ——————————————
 * **Edit:** Both of Andrew’s options are not changing the header for me. The page
   I wish to change a header image on is renamed to: wh-casino so I have updated
   my coding to display the page name as wh-casino instead of 8 as my initial post
   states.
 * In my Main Index Template (index.php) I have placed the codes in as follows:
 *     ```
       <?php
       /**
        * @package WordPress
        * @subpackage Default_Theme
        */
   
       <?php if (is_home()) get_header(); ?>
       <?php if (is_page(wh-casino()) include(get_template_directory() . 'uploads/2012/12/Sturgeons-078.jpeg'); ?>
   
       get_header(); ?>
       ```
   
 * Can anyone else advise?
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [13 years, 5 months ago](https://wordpress.org/support/topic/different-headers-coding/#post-3246753)
 * What happens if you add a forward slash before `uploads`?
    e.g
 *     ```
       /uploads
       ```
   

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

The topic ‘Different headers coding.’ is closed to new replies.

## Tags

 * [headers](https://wordpress.org/support/topic-tag/headers/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * Last activity: [13 years, 5 months ago](https://wordpress.org/support/topic/different-headers-coding/#post-3246753)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
