I have a test in my header.php to see whether we are at home to display a hero or not.
<?php if ( is_home() && have_posts() ) : ?>
<div id="hero" class="inner clearfix">
...
</div>
<?php endif ?>
But when the user lands on index.php the hero is not being shown. apparently there is no is_index() condition, does anyone know how I could test for if its home or index?
Try:
If it still doesn't work, try adding the following just before the
if
statement:Try out
is_front_page()
from the Wordpress conditional tags list.It is true when you are on the "Front Page" of your wordpress installation, which is:
Try
is_front_page()
That should return true if you are on the absolute root of site.