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:


    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)
  • Moderator Andrew Ozz


    WordPress Dev

    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 } ?>

    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.

    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:

    define('WP_USE_THEMES', false);

    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.