Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm working on a site with 3 major sections. Therefore I want to create archives for each section and those archives should be visible only in the category page and it's posts.
At this point, I made the menu visible only for the category page, but when I open a post, the widget is not displayed.

How do I create archives for specific categories, and how do I display them in a specific category and its posts?

share|improve this question
add comment

1 Answer 1

In order to display any specific conditional content on a single post based on it's category, you have to edit the template called single.php. e.g. put something like this in single.php

if ( in_category( 'category1' )) {
    //code for category1
} elseif ( in_category( array( 'category2', 'category3' ) )) {
    // code for when t
} else {
    // code for others
}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.