Fixed WordPress is_home error 10

As I mentioned before, when I upgraded to WordPress 2.3, my “is_home” tag started returning the homepage-only stuff on not just the home page, but every “page” you get by clicking “previous entries” – “/page/2″, /page/3″, etc.

I searched for a week, combing the WordPress forum, leaving a post that got no responses. Finally, I found an answer that works on my sites:

<?php if ( (is_home())&&!(is_paged()) ){ ?>
<h1>Welcome to my site, etc. etc.</h1>
<?php } ?>

This includes the homepage while excluding all those other “pages” (not to be confused with static pages, a whole other animal).

Other people are reporting that various other solutions worked for them; this was the only one that did the trick for me. I have no idea why; I’m just glad I found it.

10 thoughts on “Fixed WordPress is_home error

  1. Reply Roni Dec 22, 2007 10:20 pm

    YOU ARE A LIFE SAVIOUR!

    Thanks for posting this!

  2. Reply Chris Dec 22, 2007 11:22 pm

    You’re very welcome!

  3. Reply Hart Feb 6, 2008 6:02 pm

    I, too, found nothing about this fix (or is_paged() in general) on the Codex. My “Recent” posts query in the left sidebar was not playing nice with /2, /3, etc — this worked like a charm! Thanks for taking the time to post it,

  4. Reply Slipper Sep 4, 2008 9:08 pm

    Not working for my site. still looking for other solutions. Thanks anyway.

  5. Pingback: WordPress: Home alone : Fuyoh!

  6. Reply nate Feb 20, 2009 12:28 pm

    Thanks for a straightforward solution. You saved me so much time. If I had any money, I would give it to you :)

  7. Reply bbbbbooooo Jun 3, 2009 8:19 pm

    you rock dude.

  8. Reply a_fan Dec 16, 2010 11:00 pm

    just wanted to say thanks for this workaround!

  9. Reply David Jan 3, 2012 9:17 pm

    searched for something like this for while. thanks!

Leave a Reply

  

  

  

Web Statistics