Forums

[resolved] Invidividual posts that follow their category's template? (3 posts)

  1. mattshepherd
    Member
    Posted 1 year ago #

    In a nutshell:

    My Web site has a few specially themed categories, and one ("Characters") doesn't have a sidebar. That's the way I want it. I just commented out the get_sidebar command.

    This way, if anyone wants to see all the characters in my comic, they see them all in a row, but with no sidebar on the page.

    But if they click on one particular character entry, then WP formats everything in the single.php category, which DOES have a sidebar.

    I don't want to get rid of the sidebar, because it's useful for most single pages. Generally speaking, I want to keep the sidebar for every single page EXCEPT character pages.

    How can I tell Wordpress to follow the category-3.php template for single posts in Category 3, but follow the regular single.php template for every other single post?

    I know about if/else commands, but I'm not sure how to apply them in this case...

  2. mattshepherd
    Member
    Posted 1 year ago #

    Ha! Another 20 minutes of Codex-diving and I figured it out...

    http://codex.wordpress.org/Template_Tags/in_category

  3. moshu
    Member
    Posted 1 year ago #

    You may want to see this:
    http://guff.szub.net/2005/07/21/post-templates-by-category/
    (and on the same page there is a mention about a "category template inheritor" plugin)

Topic Closed

This topic has been closed to new replies.

About this Topic