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 is_front_page()
<?php if ( is_home() || is_front_page() ) : ?>
<div id="hero" class="inner clearfix">
...
</div>
<?php endif ?>
That should return true if you are on the absolute root of site.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With