is_home() returns TRUE on page template

I’m wondering why my link: http://localhost/?page_id=3433 returns TRUE on is_home() usage:

if(is_home()){
    var_dump(is_home());                            
    die('test');                            
}

It clearly has template-mycustomtemplate.php set under Pages > This Page in Admin Panel. Can anyone shed some light on that?

Read More

UPDATE: it returns TRUE in the loop but FALSE outside the loop. So, I can use workaround but nonetheless, it looks like a bug to me if it returns TRUE in the loop that is present in that template file.

Related posts

Leave a Reply

1 comment

  1. I discovered that it isn’t actually a bug. In the loop is_home() will refer to the currently looped object and not to the page that you accessed. In fact that’s handy!