[resolved] Content for single post also appears in category archive (2 posts)

  1. Ottens
    Posted 3 years ago #

    I want my sidebar to only appear on single posts. So I added to my content-single.php file the following code:

    <?php get_sidebar(); ?>

    Which largely works. The sidebar isn't displayed on the front page anymore, nor author and tag archives. But, for some reason, it is in category archives.

    I tried adding a conditional if_single but that doesn't make a difference.

    Am I doing something wrong?

  2. Ottens
    Posted 3 years ago #

    Stupid: I forgot to remove the sidebar code from my category.php. Obvious...

    Sorry for the superfluous topic!

Topic Closed

This topic has been closed to new replies.

About this Topic