Support » Fixing WordPress » is_home doesn't respect page_on_front option

  • Resolved scottconnerly


    I have set the Home to be a page, have set the blog to be a secondary page, /news/.

    is_home() is only showing as true on /news/ and my template file ‘home.php’ is loading for /news/.

    is_front_page() is respecting the page_on_front option.

    It looks like the issue is with $this->is_singular is being included in the evaluations for is_home in parse_query().

    Is there another way to make it so that the page_on_front option is respected? Its not like I have any crazy loops going on here, its just a simple page.

Viewing 3 replies - 1 through 3 (of 3 total)
  • esmi


    I’d suggest reviewing Conditional_Tags – specifically what is_home() and is_front_page() test for.

    I think you’re compounding the confusion by using home.php as your template file name. home.php is a reserved name on many servers. Try renaming the template to homepage.php.



    From the Conditional Tags page:
    so if you’ve set a static Page for the Front Page (see below), then this will only be true on the Page which you set as the “Posts page”

    So you’re saying the home page isn’t going to be the home page? The root of the blog is going to be the is_home page?



    is_home() is only showing as true on /news/

    This is the correct behaviour for is_home(). It’s true only on your main posts page.

    If you’re using a static front page, you need to look at is_front_page(). Also, do take note of what I said about your template file name. It can cause confusion and, in some case, significant site display issues.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘is_home doesn't respect page_on_front option’ is closed to new replies.