custom headers for static home page and posts page

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

<?php
if(is_home()){
include(TEMPLATEPATH.'/header_front.php');}

else {
include(TEMPLATEPATH.'/header_default.php');}

?>

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

Read More

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

Related posts

Leave a Reply

2 comments

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

    The WordPress API accommodates for using different headers.

    <?php 
           if (is_front_page() ) {
                   get_header( 'front' );
    
            } else {
                   get_header();
           }
    ?>
    

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

  2. 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

    <?php
    /*
    Template Name: blog
    */
    $pagenum = $wp_query->query_vars;
    $pagenum = $pagenum['paged'];
    
    if (empty($pagenum)) {
    $pagenum = 1;
    }
    
    query_posts("posts_per_page=10&paged=$pagenum");
    ?>