Support » Fixing WordPress » Different Header for Static Front Page

  • Is it possible to use a different header in the Static Front Page?
    I’ve uploaded a specific header (header_front.php) into my blog template, but I can’t figure out how to call it through the “require” command:

    require('./blog/header_front.php');
    require('http://www.mysite/blog/wp-blog-header.php');
    require('http://www.mysite/blog/header_front.php');
    etc...

    Using the default calls my blog header, and that works fine, but is it possible to call “header_front.php” in my static front page?

Viewing 4 replies - 1 through 4 (of 4 total)
  • It is, with the is_page(xx); where xx=page’s ID, or you can use an if - else in your theme’s header.php to change what is displayed on the front page. Like that:

    <?php if ( is_page(xx) ) { ?>
    -- put your stuff here --
    <?php } else { ?>
    -- normal header --
    <?php } ?>
    Thread Starter bburns

    (@bburns)

    Azaozz,
    Thanks for this tip.
    I may be doing thing wrong, but I have my static front page as a separate index.php file outside my WP folder. I don’t edit through WP, and therefore I’m sure how to assign it a number.
    Does “if_else” work with a direct url? Or, is there a way to number my index.php?
    Thanks again.

    “include” never works with an URL, only with server path!

    And if your file is not part of WP, I don’t really understand what are you trying to do.

    Thread Starter bburns

    (@bburns)

    I have an index.php file in the root directory and I’m trying to use it as a Static Front Page. The way I understand it, I need to pull the header with:

    <?php
    define('WP_USE_THEMES', false);
    require('./wordpress/wp-blog-header.php');
    get_header();
    ?>

    which works fine, but I would like to use different header.
    And if it isn’t obvious already, I don’t have a firm grasp on php.
    Have I misunderstood how to create a Static Front Page?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Different Header for Static Front Page’ is closed to new replies.