Title: Changing header.php files?
Last modified: August 20, 2016

---

# Changing header.php files?

 *  Resolved [Alison](https://wordpress.org/support/users/anonymical7/)
 * (@anonymical7)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/changing-headerphp-files/)
 * Hi guys,
 * I have found bits and pieces of things online but not anything extensive for 
   the newbie.
 * If I have made header files such as:
    **headercontact.php headerwork.php
 * How can I get them to show up on the pages that display that header?
 * I found this and modified it online, but each time I try to add it to my functions.
   php file, I get syntax errors.
 * `if (is_page(‘contact’)){ (TEMPLATEPATH.’/headercontact.php’); } elseif (is_page(‘
   gallery’)){ (TEMPLATEPATH.’/headerwork.php’); } else { (TEMPLATEPATH.’/header.
   php’);`
 * If theres a plugin that could conceivably rotate header.php files that would 
   be cool, but I cant seem to find this and figure I need to learn this.
 * Thanks! A

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

 *  [Pioneer Web Design](https://wordpress.org/support/users/swansonphotos/)
 * (@swansonphotos)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/changing-headerphp-files/#post-3114704)
 * It may be easier to create new [page templates](http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates)
   and use your code from the files you noted above to replace get_header in new
   page templates (then assign new templates to pages desired).
 *  [Peter_L](https://wordpress.org/support/users/peter_l/)
 * (@peter_l)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/changing-headerphp-files/#post-3114706)
 * Solution is quite simple.
 * Step 1: rename your header files to
    header-contact.php header-work.php …
 * Step 2:
    In your template files, f.e. index.php or page.php or single.php: instead
   of calling get_header(), you call get_header(‘contact’); or get_header(‘work’);
 * get_header() will call the header.php file.
 *  Thread Starter [Alison](https://wordpress.org/support/users/anonymical7/)
 * (@anonymical7)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/changing-headerphp-files/#post-3114707)
 * Ah! Thanks! Im going to try it! A
    Really appreciate the fast response!
 * If anyone else has feedback, im open to all!
 *  Thread Starter [Alison](https://wordpress.org/support/users/anonymical7/)
 * (@anonymical7)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/changing-headerphp-files/#post-3114712)
 * It worked! But I seem to have lost my editing bar when logged in on those pages.
   
   You know, the grey one at the top from the wp-admin… but it worked! Thanks!
 *  [Peter_L](https://wordpress.org/support/users/peter_l/)
 * (@peter_l)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/changing-headerphp-files/#post-3114714)
 * make sure you have wp_head() included in the new header-XXX.php files.
 *  Thread Starter [Alison](https://wordpress.org/support/users/anonymical7/)
 * (@anonymical7)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/changing-headerphp-files/#post-3114716)
 * Ah, yes, actually it was the `<?php do_action('wp_footer'); ?>`
    that was missing.
   My mistake.
 * Thanks all!

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

The topic ‘Changing header.php files?’ is closed to new replies.

## Tags

 * [code](https://wordpress.org/support/topic-tag/code/)
 * [custom](https://wordpress.org/support/topic-tag/custom/)
 * [functions](https://wordpress.org/support/topic-tag/functions/)
 * [header](https://wordpress.org/support/topic-tag/header/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [rotate](https://wordpress.org/support/topic-tag/rotate/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 6 replies
 * 3 participants
 * Last reply from: [Alison](https://wordpress.org/support/users/anonymical7/)
 * Last activity: [13 years, 8 months ago](https://wordpress.org/support/topic/changing-headerphp-files/#post-3114716)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
