Hi,
I want to create a tall banner on the homepage only, and have it much smaller on all the other pages. - since I want it above the menu, it will have to go in the header-top-navbar file.
so can I have a different one on this page - will i have to create a separate base file? if so how do i go about using it?
hope I am making sense.
Don’t create a new base.php
. If you want to load a different template file, use this in base.php
:
if (is_front_page()) {
get_template_part('templates/header-home');
} else {
get_template_part('templates/header-top-navbar');
}
You could also just add conditionals within one header template file:
<header>
...
<?php if (is_front_page()) : ?>
<h1>I'm only on the home page</h1>
<?php endif; ?>
...
</header>
ah brilliant, thanks Ben - thats all I needed!