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?
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.
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!