[wp-hackers] Difference between is_home and is_front_page

Nathan Rice ncrice at gmail.com
Thu Jan 22 19:46:49 GMT 2009


Close, but no.
If your About page is set as your front page, and you are viewing
http://example.com, then:
is_home() will return false
is_front_page() will return true.

If your About page is set as your front page, and your Blog page is set up
to list blog posts, and you are viewing http://example.com/blog then:
is_home() will return true
is_front_page() will retrun false

(Please correct me if I'm wrong, anyone).

Nathan


On Thu, Jan 22, 2009 at 2:41 PM, Dan Gayle <dangayle at gmail.com> wrote:

> So, for instance, if the "About" page is set as the home page in options,
> is_front_page() and is_home() will both return true if I'm looking at
> http://example.com
>
> But if I'm looking at http://example.com/about, is_front_page will return
> true, while is_home() will return false.
>
> That's correct, right?
>
>
>
> On Jan 22, 2009, at 11:31 AM, Nathan Rice wrote:
>
>  is_home is limited in that it only returns true if you are on the ACTUAL
>> home page, whereas is_front_page returns true even if you're using a
>> specific page as your blog's homepage.
>>
>> Nathan
>>
>> My Website
>> http://www.nathanrice.net/
>>
>> My Twitter
>> http://twitter.com/nathanrice
>>
>>
>> On Thu, Jan 22, 2009 at 2:27 PM, Dan Gayle <dangayle at gmail.com> wrote:
>>
>>  Can anyone explain the difference between is_home() and is_front_page()?
>>>
>>> They appear to me, from the Codex documentation, that they do the same
>>> thing.
>>> _______________________________________________
>>> wp-hackers mailing list
>>> wp-hackers at lists.automattic.com
>>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>>>
>>>  _______________________________________________
>> wp-hackers mailing list
>> wp-hackers at lists.automattic.com
>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>>
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list