Difference between is_home() and is_front_page()

Most of the WordPress Conditional Tags are easy to understand and pretty self-explanatory with their terminology but these two tags – is_home() and is_front_page() were two which left me confused. So I searched for the difference between two and found that both are actually very different in their approaches. Though both of them give same result in few cases but it doesn’t mean both tags mean the same thing.

is_home()

Though the tag says home but it actually looks for the page where all your recent posts are shown. If you are on the homepage and you are showing recent posts there, is_home() will return true. And if your front page is set static, is_home() will return false for it but will return true for any inner page where your recent posts are being shown.

is_front_page()

This tag actually checks if you are on the front page or not. If you are on the frontpage of the blog whether it shows recent posts or is a static page, it will return true. Any inner page even if it shows recent posts will give false for is_front_page().

6 Comments


  1. This is one of those tags that trips me up from time to time. Thanks for this post!

  2. uchu

    I don’t know why is_home() returned true on pages where it didn’t show recent posts in your case.


  3. I use is_home() for a couple sites where I have a home.php template, that has more or less static content on, some sites I have done some boxes which show some custom WP_Query loops for last 5 of x or whatever too, but it doesn’t even have to have a loop at all.


  4. I don’t think that’s entirely accurate.

    I use is_home() for a couple sites where I have a home.php template, that has more or less static content on, some sites I have done some boxes which show some custom WP_Query loops for last 5 of x or whatever too, but it doesn’t even have to have a loop at all.

    I only ever really used is_home too, and I do on these pages for multiple different things, and never had an issue of it returning false when my homepage didn’t show recent posts. Maybe this has something to do with my use of the home.php template. Most likely yes. just sayin…

Comments are closed.