How do I use different headers and footers for WordPress sites?

You’ll be happy to know it is very simple. In a current project the home page is going to use a different header than the rest of the site. The way to have two different headers is to create header.php with your main header and create another file and name it header-home.php with your home header.

In your index.php page (which is your default home page in WordPress) use this code at the top:

index.php

[cc lang=”php”]

[/cc]

In your page.php page use this code at the top:

page.php

[cc lang=”php”]

[/cc]

And that’s it. Easy. Peasy.

Leave a Reply

Your email address will not be published. Required fields are marked *