WordPress.org

Support

Support » Themes and Templates » Sidebar won't display for posts in one category only

Sidebar won't display for posts in one category only

  • I’m helping out with a WordPress site that’s having an issue. For some reason, posts put into the category of Blog don’t display a sidebar.

    The main site is here: http://www.familytree.com/
    This shows the sidebar as expected.

    The archive page for the Blog category is here: http://www.familytree.com/blog/
    This shows the sidebar as expected.

    But when you look at individual post in the Blog category, such as this: http://www.familytree.com/blog/foods-eaten-by-our-ancestors/
    The sidebar disappears.

    This isn’t the case with posts in other categories. For example, here’s a post in the Learn category: http://www.familytree.com/learn/what-is-genealogy/

    I’ve gone thru all of the theme files and the only possible thing I’ve found that might be causing this is this bit of code in the index.php file:

    <!-- Only for articles, not blog -->
    <?if (!strstr($_SERVER['REQUEST_URI'],"/blog/")){?>

    If I whack that whole second line, posts categorized under Blog don’t display at all. The pages come up as blank. The category archive page for the Blog category displays normally as does the rest of the site.

    I’ve looked at all of the other files and can’t seem to find anything else referring to this problem. Anyone have any thoughts on this one?

  • The topic ‘Sidebar won't display for posts in one category only’ is closed to new replies.