WordPress.org

Ready to get started?Download WordPress

Forums

is_home () not working for posts page (8 posts)

  1. Brian
    Member
    Posted 5 years ago #

    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>
  2. Brian
    Member
    Posted 5 years ago #

    Also, this page does not show up in my stats using wordpress.com stats plugin

  3. Brian
    Member
    Posted 5 years ago #

    anybody? is this really that perplexing?

  4. Samuel Wood (Otto)
    Tech Ninja
    Posted 5 years ago #

    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?

  5. Brian
    Member
    Posted 5 years ago #

    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?

  6. Samuel Wood (Otto)
    Tech Ninja
    Posted 5 years ago #

    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.

  7. seriocomic
    Member
    Posted 5 years ago #

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

  8. Brian
    Member
    Posted 5 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic