WordPress.org

Support

Support » How-To and Troubleshooting » is_home () not working for posts page

is_home () not working for posts page

  • I’m using the following code to set my page title. I’m using a static front page and have set my posts page accordingly. is_home() should work on the posts page (annamayer.com/news), however, it doesn’t.

    Any ideas on what to change to correct this?

    <title>
    <?php bloginfo('name');
     if ( is_404() ) : _e(' &raquo; ', 'ProPhoto'); _e('Not Found', 'ProPhoto');
     elseif ( is_front_page() ) : _e(' &raquo; ', 'ProPhoto'); bloginfo('description');
     elseif ( is_home() ) : _e(' &raquo; ', 'ProPhoto'); bloginfo('description');
     else : wp_title(); endif; ?>
            </title>

Viewing 7 replies - 1 through 7 (of 7 total)
  • Also, this page does not show up in my stats using wordpress.com stats plugin

    anybody? is this really that perplexing?

    Moderator Samuel Wood (Otto)

    @otto42

    WordPress.org Tech Dude

    It’s perplexing because nobody really understands what your question is.

    Try to be more clear. What are you expecting to see? What do you actually see?

    when I use is_home() in the context above it should return the description field after the blog title in the title bar. On the Front Page (static) it behaves as expected. On the posts page, it doesn’t. It just shows the blog title. The code is the same other than the is_home() replacing is_front_page.

    What about this code is incorrect for displaying the blog title and blog description on the posts page?

    Moderator Samuel Wood (Otto)

    @otto42

    WordPress.org Tech Dude

    Hmmm.. I can’t explain that. is_home returns true for the main blog posts page, that is correct. And I can verify that it works on my own site. So, something else has got to be affecting it somehow.

    Have you tried using <?php wp_reset_query(); ?> ?

    I figured it out. I’m using the All in One SEO plugin with Rewrite titles enabled. The field for the “Home” title was blank. Once I got that filled in, it was fine.

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