Support » Fixing WordPress » is_page() not working for static “Posts Page”

  • Hi,
    I have setup a static posts page. The WordPress Page is “Weblog” with a slug of ‘weblog’. In my sidebar.php, I have the following code:

     //DO stuff like show categories

    This doesn’t seem to work.
    However, if I go to my settings and remove the static setting for blog posts page, and then navigate back to the weblog page, the above code outputs the expected result.

    It seems, then, that signifying a page as the static page for Blog Posts breaks the is_page() function for that page. Is this a known issue? I couldn’t find anything mentioning it.


Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Samuel Wood (Otto)

    (@otto42) Admin

    The is_home() stuff got messed around with a bit in this release. Try using just is_home() to check for the main blog page. If you need to check for the static front page, try is_front_page().

    Thanks Otto. Should I do this even if the weblog page mentioned above is different from the home page? I have another page with slug of sitehome set as the static Home page and it’s working fine.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘is_page() not working for static “Posts Page”’ is closed to new replies.