<?php if( is_home() ) : ?> Conditionals Not Working
Hey all,
Sorry to post regarding this but i am trying to use some simple conditionals that work fine on other templates, but are not working with the roots theme.
These are the conditionals i am trying to use:
I mainly need the "is_home" to work.. I am guessing that the roots activation / cleanup process is effecting this somehow.. ive deleted the front-page.php file and am using the index.php / loop.php as my main template files..
Any help on this would be great.
Regards, Darren
both are working fine over here. closing until more details are provided - sounds like a template hierarchy issue. if you try using the conditionals in header.php or footer.php you can easily see they're working as intended
kk cheers mate... i'll look into it.. Again thanks for the awesome work you have put into this !!! more worried about getting this issues fixed: https://github.com/retlehs/roots/issues/426
I am also having this issue. Using WordPress 3.4 and Roots 5.1.0, no child theme. Placing this code in the HEADER.PHP line 26.
<?php if ( is_front_page() ) : ?>
works fine, however the following does not:
<?php if ( is_home() ) : ?>
Has anyone figured this out? Placing either in footer.php and can't get it to work. It omits the code, but wont load conditionally on front_page/home.
I found a workaround to the problem. If you include before it seems to do the trick. Thanks!
Thanks for posting your solution, will try this.
Regards, Darren
I had the issue in the page-header.php template.
Added a wp_reset_query(); at the top of the file and it has fixed the problem. (hopefully won't cause other issues)