Proper tag for home page conditionals

If you’re trying to use a conditional to display or not display something on your home page, you should be aware that this conditional:

is_home()

only works for the blog posts page.  If you have your home set to a static page, it won’t affect that page.  It will continue to work for whatever page you have set as the blog posts page.  In order to create a conditional that works on any home page, you need to use:

is_front_page ()

This was added in 2.5 and corresponds to the terminology used in Settings -> Reading, where you choose the “front page” of your site – whether it’s your blog posts or a static page.

Read more in the WordPress codex on conditionals.

Comments, Corrections, Suggestions?

All trademarks and copyrights appearing on this website are the property of their respective owners. All rights Reserved.

Help Panel

I get an error message when I try to replay a video.
Most videos on this site are URL protected. If you don't watch a video within a minute, the URL expires. So if you want to replay a video, just refresh the page.

Key to Icons

  • Requires Administrator level
  • Video about a plugin
  • Browser issue
  • Video is a tutorial

WordPress Versions

  • Version 2.8
  • Version 2.9
  • Version 3.0
  • Version 3.1
  • Version 3.2
Help