I would like to display a div, only on the homepage. Is this possible?
I have a banner in the header.php file and only want to display this banner div on the homepage.
How could I achieve this?
Thanks in advance.
I would like to display a div, only on the homepage. Is this possible?
I have a banner in the header.php file and only want to display this banner div on the homepage.
How could I achieve this?
Thanks in advance.
Depending on your setup you could use the conditional is_home()
or is_front_page()
like this:
<?PHP if( is_home() ) { ?>
<div> … </div>
<?PHP } ?>
See also the question "When to use is_home() vs is_front_page()?" for further details on the defferences between the two…
PS: you should consider using a child theme for this.