• Here’s my problem I have a category page (Category) which has a listing of all pages contained in that category in the sidebar.

    But when I click on an entry the list disappears.

    I would like to have the listing of categories in the sidebar change per post depending on what category that post is in.

    So, if you visit a page in the about category, a listing of about’s entry appears in the sidebar.

    I assume I have to write an <?php if (belongs to this category()) { ?> tag for each category name? is there anyway to get the category type from the post then relay that to the sidebar?

    Am I on the wrong trail?

    Help, my template is taunting me!

Viewing 3 replies - 1 through 3 (of 3 total)
  • This would be in sidebar.php.

    But something to consider….what if a post is in multiple categories? Which list of category posts do you show then?

    Thread Starter funtimeben

    (@funtimeben)

    Ahhhh my brain DewVirus!

    Um at the moment the posts wouldn’t be in more than one category

    There is an in_category() function (which takes a category ID # as it’s parameter) that you might be able to use. You’ll probably have to create a plugin or create a sererate WordPress loop on your sidebar to accomplish this.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Controlling my single category sidebar’ is closed to new replies.