WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How can I use a different header & footer file for just the homepage? (3 posts)

  1. adam533
    Member
    Posted 5 years ago #

    Hello,
    I am setting up a clients site using WordPress, but for the homepage I need to use a different header and footer file from the rest of the site.

    What is the best method for setting this up?

    Thanks in advance,
    Adam

  2. MichaelH
    Member
    Posted 5 years ago #

    Take a look at Conditional Tags to help you.

    <?php
    if (is_home() ) {
    get_header('myheader'); // include header-myheader.php
    get_sidebar('xyz'); // include sidebar-xyz.php
    } else {
    get_header();
    get_footer();
    }
    ?>
  3. adam533
    Member
    Posted 5 years ago #

    Great,
    I will try that when I get in the office tomorrow morning!

    Thanks for your help.
    Adam

Topic Closed

This topic has been closed to new replies.

About this Topic