is_home() returns false on the home page! When is the home page NOT the home page?

I’ve placed the following code in my functions.php file

if(!is_home()){ echo "Not Home";}
if(is_home()){ echo "Home";}

However, no matter what page I’m on, I get “Not Home”, And I’m real sure I’m on the home page, but still get “Not Home”. What am I missing?

Related posts

Leave a Reply

1 comment

  1. If you just place it in functions.php, not in a function in functions.php, it will be called too early. WordPress includes functions.php before it parses the URL and determines whether you are actually on the homepage or not.

    Since WordPress 3.1 there is an extra warning (only visibile if you enable WP_DEBUG) if you call these too early, to prevent these confusing situations.