Support » Fixing WordPress » is_home() not working

  • Resolved gzezza

    (@gzezza)


    I noticed that is_home() does not return true when you are using a static page as your Front page in WP 2.1
    The alternative suggested in 49832 works (if you change the != into ==):
    <?php if ($_SERVER['QUERY_STRING'] == '') { ?>
    ... home page stuff ...
    <?php } ?>

    but I was wondering if there were other solutions.

Viewing 4 replies - 1 through 4 (of 4 total)
  • gzezza

    (@gzezza)

    I finally found a link to the discussion where they make the point that is_home() should not return true if you choose a static front page.
    So in WP 2.1 is_home() is assumed to return false when the home page is not from the blog, and there is nothing wrong with that…

    i’m a bit confused with all this – I’m NOT using a static front page, but for me, is_home is returning TRUE for all pages! Can’t I limit it to only the default front page of blog posts?

    This isn’t resolved – I’m having the same trouble as functionista now that I’ve upgraded to 2.3. The Is_frontpage doesn’t help – it removes the stuff off the front page of blog posts, too.

    If you’re using a static page for your front page, then you need to figure out the ID of that static page – let’s say it’s 23 – and use this:

    if (is_page(’23’)) { … }

    This works fine in WP 2.3.1

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘is_home() not working’ is closed to new replies.