Title: Multiple header files
Last modified: August 19, 2016

---

# Multiple header files

 *  [harmsm](https://wordpress.org/support/users/harmsm/)
 * (@harmsm)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/multiple-header-files/)
 * I would like to use one header file for index.php and another header file for
   all of the other pages.
 * On the website [http://www.wprecipes.com/how-to-use-multiple-custom-headers-on-a-wordpress-theme](http://www.wprecipes.com/how-to-use-multiple-custom-headers-on-a-wordpress-theme),
   it suggested using conditional tags, but I don’t know that the tag would be for
   index.php
 * Would someone know?

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

 *  [stvwlf](https://wordpress.org/support/users/stvwlf/)
 * (@stvwlf)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/multiple-header-files/#post-997173)
 * I’m assuming by index.php you mean your posts page
 * If so, the code would be this
 * <?php
    if ( is_home() ){ <?php include(TEMPLATEPATH.’/headerblog.php’); ?>
 * } else {
    <?php include(TEMPLATEPATH.’/headerdefault.php’); ?> } ?>
 *  Thread Starter [harmsm](https://wordpress.org/support/users/harmsm/)
 * (@harmsm)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/multiple-header-files/#post-997295)
 * Thanks for the code. I’m not overly clear on what is meant by the posts page.
 * Let me clarify. On the blog home page, I would like to use one header. On the
   other pages of the blog (categories, archives, etc), I would like to use a different
   header.
 * Thanks
 *  [stvwlf](https://wordpress.org/support/users/stvwlf/)
 * (@stvwlf)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/multiple-header-files/#post-997303)
 * “posts page” is one and the same as “blog home page”
 * The code I posted before is for that purpose
 *  Thread Starter [harmsm](https://wordpress.org/support/users/harmsm/)
 * (@harmsm)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/multiple-header-files/#post-997334)
 * I tried the code provided above and got the error message:
 * Parse error: parse error in c:\xampp\htdocs\wordpress\wp-content\themes\test\
   header.php on line 3.
 * What I did was copy the code you provided above and paste it into a header file
   and saved it as header.php.
 * I used my original header.php file and created two files called headerdefault.
   php and headerblog.php. This was just to test if everything would work.
 * Would you know what would cause the parse error?
 * Thanks
 *  [stvwlf](https://wordpress.org/support/users/stvwlf/)
 * (@stvwlf)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/multiple-header-files/#post-997336)
 * See if the single quotes in the code are text characters or those fancy quotes.
   They look like fancy ones – change them to plain.
 *  Thread Starter [harmsm](https://wordpress.org/support/users/harmsm/)
 * (@harmsm)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/multiple-header-files/#post-997435)
 * I’ve copied the single quotes from a functional php file but get the same error.
 * Could it be something with the syntax of the code?
 *  [geezerd](https://wordpress.org/support/users/geezerd/)
 * (@geezerd)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/multiple-header-files/#post-997438)
 * I need the same thing, but will that code still work if I am using a new static
   page for the home page, and have a new page named “Posts” set as the blog page?
 * I think I tried that awhile back and it failed when I set a static page as home.

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

The topic ‘Multiple header files’ is closed to new replies.

## Tags

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

 * 7 replies
 * 3 participants
 * Last reply from: [geezerd](https://wordpress.org/support/users/geezerd/)
 * Last activity: [17 years, 3 months ago](https://wordpress.org/support/topic/multiple-header-files/#post-997438)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
