Fixed Wordpress is_home error

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.

Related posts:
  1. Wordpress 2.3 is_home fix
  2. Wordpress: how to have different sidebars on static front page
  3. Wordpress 2.9 “missed schedule” future posts error
  4. Creating a static front page on a blog
  5. Speeding up WordPress

10 Responses to “Fixed Wordpress is_home error”

  1. Roni said:

    YOU ARE A LIFE SAVIOUR!

    Thanks for posting this!

  2. Sapphire said:

    You’re very welcome!

  3. Hart said:

    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. Wordpress 2.3 is_home fix said:

    [...] Note: found the fix. [...]

  5. Flagship or Niche said:

    [...] some loyal readers, and I also have people who show up, thank me profusely for the answer to the Wordpress is_home problem, or whatever I’m ranking highly for that week, and go away never to be heard from again. [...]

  6. Slipper said:

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

  7. Adhamox said:

    thankyou :)

  8. WordPress: Home alone : Fuyoh! said:

    [...] a certain action on a WordPress blog’s home page (and only the home page) and thanks to this site, I have [...]

  9. nate said:

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

  10. bbbbbooooo said:

    you rock dude.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>