As great and simple as WordPress is, sometimes the simplest functions can be the most frustrating.
is_front_page() are two such functions that seem to be a stumbling block for some. They are extremely similar, but have major differences.
The Stumbling Block
is_front_page are WordPress conditionals that can be used to display (or not display) elements on the home page of your website. There’s a slight difference in that
is_front_page will return true if the user is on the page that is set to the Front Page in Settings->Reading->Front page, as well as the page of posts. Where as
is_home will return true on the posts index page, whether or not it’s the website’s home page or not.
I think that’s where the confusion is. WordPress is a blogging platform at heart and therefore the Home Page is normally the Blog Index, so the conditional makes sense semantically. But as we use WordPress as a CMS, designs call for a static page to be used as a the Home Page, putting the Blog Index elsewhere on the site. Which now puts
is_home semantically out of whack.
Why use is_front_page()? Why use is_home()?
A few years ago, I ran into this exact scenario where I learned the differences between the two. The redesign called for a static homepage but then a separate blog page. There was a specific 3 item navigation that was only to be displayed on the website’s Home Page and for whatever reason it wasn’t displaying on the Home Page, but rather on the Blog Page (Blog Index). In reading the codex on is_home, I realized that I wasn’t using the proper conditional for this scenario. In the previous projects, this method worked only because the Blog Index was the Home Page of the website. I got lucky in that it worked. But in learning the differences because of re-design project, I went back to the two previous projects and placed in the proper ones.