Viewing 7 replies - 1 through 7 (of 7 total)
  • 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

    (@harmsm)

    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

    “posts page” is one and the same as “blog home page”

    The code I posted before is for that purpose

    Thread Starter harmsm

    (@harmsm)

    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

    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

    (@harmsm)

    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?

    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.