Alex Rivera | Logout

What are the different ways to detect home page in wordpress?

Asked 2011-02-07T11:27:20.437
10

What are the different ways to detect wordpress homepage

except is_front_page() and is_home()

Thanks

Edit
Report

1 Answer

20

I just do the following:

if ( $_SERVER["REQUEST_URI"] == '/' ) { }

It works and doesn't overcomplicate things, especially as is_front_page() and is_home() don't always work as you'd expect them to.

answered 2011-02-07T11:59:20.113

Your Answer