I have a page that I designated as my front page using the reading
portion of settings in the dashboard. When I place a script inside of an if statement using is_front_page
in functions.php, it only runs on that designated front-page, and not the others (indicating the page has been designated correctly).
However, I have an if
statement in my header.php file that also uses is_front_page
, and that seems to be triggering on all my pages (including the ones that I have not designated as the front page).
What is going on? Can you not run is_front_page
from within header.php and have that code only apply to the front-page header? Am I missing something?
This is the code that I have placed in my header.php file that is returning true on all pages
<?php echo ( is_front_page ) ? 'frontPageLogo' : NULL; ?>
(I believe it is returning true on all pages because it always echoes 'frontPageLogo')
is_front_page()
(with parentheses)