WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

have a site w/a static home page and a posts page and then a number of other static pages - i set up a custom header for the home page and then another all other pages like this in the header


else {


it works perfectly except that the posts page is displaying header_front.php instead of header_default.php

so i guess im asking how i get wordpress to realize that the posts page isnt the home page

share|improve this question
use is_front_page() for static front pages. – Wyck Mar 27 '11 at 23:20
You're using the wrong conditional. "is_home()" applies to the Blog Posts index, whether displayed on the Front Page or not. As Wyck said, you need to use "is_front_page()" if you want to output something (or not) on the Front Page. – Chip Bennett Mar 28 '11 at 3:05
yeh i tried that already and it displayed header_default.php on both the static home page and the blog - so it did change the header on the blog but it unfortunately changed it on the home page too - v frustrating - thx tho! – j1mmy Mar 29 '11 at 5:24

Instead of using include(TEMPLATEPATH use the built in WordPress API.

The WordPress API accommodates for using different headers.

       if (is_front_page() ) {
               get_header( 'front' );

        } else {

Your custom header template should be named header-front.php and your default header should be named header.php

share|improve this answer

ok so i guess there was some code in the template for the home page that i c&ped off some site that was making wordpress think it was the blog page - once i excised that and then did is_front_page() everything was cool - so thx

this is the code if anyone might be at all interested - i was under the impression it was necessary to designate a template - obvs theres a bunch of extra stuff in there tho

Template Name: blog
$pagenum = $wp_query->query_vars;
$pagenum = $pagenum['paged'];

if (empty($pagenum)) {
$pagenum = 1;

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.