Title: get_header
Last modified: August 19, 2016

---

# get_header

 *  Resolved [jpmaximilian](https://wordpress.org/support/users/jpmaximilian/)
 * (@jpmaximilian)
 * [18 years ago](https://wordpress.org/support/topic/get_header/)
 * I’d like to add a custom get_header for my archive, so that the header is different,
   just for the archive. I’ve tried creating a page archiveheader.php and then in
   archive.php instead of <?php get_header(); ?> I use <?php get_archiveheader();?
   >
 * This didn’t work, I don’t really know what I’m doing so perhaps someone could
   help me out.

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

 *  [whooami](https://wordpress.org/support/users/whooami/)
 * (@whooami)
 * [18 years ago](https://wordpress.org/support/topic/get_header/#post-779184)
 * > I’ve tried creating a page archiveheader.php and then in archive.php instead
   > of <?php get_header(); ?> I use <?php get_archiveheader(); ?>
 * `get_header()` is a function, so what you just described is never going to work,
   unless you want to write another function.
 * create a file named whatever.php, put it inside your current theme’s directory.
 * Instead of using `<?php get_header(); ?>` use this:
 * `<?php @include_once($_SERVER["DOCUMENT_ROOT"]."/wp-content/your-theme-name/whatever.
   php");?>`
 * change the theme name obviously.
 *  Thread Starter [jpmaximilian](https://wordpress.org/support/users/jpmaximilian/)
 * (@jpmaximilian)
 * [18 years ago](https://wordpress.org/support/topic/get_header/#post-779186)
 * I thought maybe I could pass a different .php file to the function get_header.
   But like I said I don’t really know what I’m doing. What you suggested didn’t
   work for me. I have no header on that page, and all of the css formatting is 
   gone. I guess the get_header function does more than just include the header.
   php file? I wouldn’t mind “rewriting” the get_header function, if you could tell
   me where it is. All I would have to do is change header.php to another name, 
   and rename the function?
 *  [whooami](https://wordpress.org/support/users/whooami/)
 * (@whooami)
 * [18 years ago](https://wordpress.org/support/topic/get_header/#post-779187)
 * it calls header.php which is where your style.css is called yes.
 * what exactly are you trying to do?
 * What I provided does work — I use it all over my own site.
 * > I’d like to add a custom get_header for my archive, so that the header is different,
   > just for the archive.
 * you do not need to rewrite a function. What you need to do is LOOK at what header.
   php does, and include the bits of it that are necessary. Much of it is. Open 
   it and look.
 * I assumed you had figured out that much if you were trying to call a different
   file.
 * My bad — never overestimate anyone on these forums.
 *  Thread Starter [jpmaximilian](https://wordpress.org/support/users/jpmaximilian/)
 * (@jpmaximilian)
 * [18 years ago](https://wordpress.org/support/topic/get_header/#post-779188)
 * I’m trying to add a custom header so that instead of showing my blog title and
   a description of the blog, it shows archive and what kind of archive is being
   shown.
 *  [whooami](https://wordpress.org/support/users/whooami/)
 * (@whooami)
 * [18 years ago](https://wordpress.org/support/topic/get_header/#post-779189)
 * > What you need to do is LOOK at what header.php does, and include the bits of
   > it that are necessary. Much of it is. Open it and look.
 * By include, I mean that you need to copy that file, and use IT as your base, 
   change ONLY what needs to be changed to achieve your goal. leave the rest intact.
 *  Thread Starter [jpmaximilian](https://wordpress.org/support/users/jpmaximilian/)
 * (@jpmaximilian)
 * [18 years ago](https://wordpress.org/support/topic/get_header/#post-779191)
 * Okay, I got it to work now, the only thing I did differently is add a space:
 * <?php include_once($_SERVER[“DOCUMENT_ROOT”] . “/wp-content/themes/yourblog-20-
   theme/archiveheader.php”); ?>
 * instead of
 * <?php @include_once($_SERVER[“DOCUMENT_ROOT”].”/wp-content/themes/yourblog-20-
   theme/archiveheader.php”);?>
 * I don’t know why that would make a difference. I thank you for your help in spite
   your subtle insult towards me.

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

The topic ‘get_header’ is closed to new replies.

## Tags

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

 * 6 replies
 * 2 participants
 * Last reply from: [jpmaximilian](https://wordpress.org/support/users/jpmaximilian/)
 * Last activity: [18 years ago](https://wordpress.org/support/topic/get_header/#post-779191)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
