Different inside v home page in custom WordPress theme

I want to use a different header style for the home page than for inside pages of my site. Specifically, I want the header section to be less tall on the inside pages. Should I use a different header.php file for the home page? If so, how?

I’m having a hard time getting ideas using Google, so if anyone has a helpful link to the appropriate resource that’d be great.

Related posts

Leave a Reply

1 comment

  1. WordPress has a home page boolean function is_front_page() (true if is front page otherwise false)

    Add a class to the header/body/whatever parent so

    <header class="header<?php if(is_front_page()){ ?> home_header<?php } ?>">
    </header>
    

    and simply reference the class in CSS.

    WordPress codex reference