Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I set my 'About' page as home page, its permalink (my_site/about/) became my_site/ as a result. Is_page('about') returns TRUE on my local server but FALSE on online server.

Why is that ?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

You can use the function is_front_page().

Put this where you want to check if is frontpage

if( is_front_page() ) {
    echo 'I am the frontpage';
}

It returns TRUE when the main blog page is being displayed and the Settings->Reading->Front page displays is set to "Your latest posts", or when is set to "A static page"

share|improve this answer
    
Works, thanks Pontus! Just out of curiosity, what could cause the difference of behaviour between local and online servers? –  drake035 Jan 29 '13 at 16:14
    
Maybe you did forget to set the correct template? –  Pontus Abrahamsson Jan 29 '13 at 16:21
    
Hmm nope, I am quite sure it was the right template. –  drake035 Jan 29 '13 at 16:26
    
Okey, its hard to say from here. But good its working now :)! –  Pontus Abrahamsson Jan 29 '13 at 16:30
    
Lol yep thanks again! –  drake035 Jan 29 '13 at 20:56
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.