WordPress.org

Ready to get started?Download WordPress

Forums

Individual post styling by category (2 posts)

  1. ShadyCraig
    Member
    Posted 8 years ago #

    For some time I've been gradually building my blog up and customising it. I've got some different categories shown using a different category (eg category-1.php) file, and that works well, but when someone click on the permalink the post is displayed using single.php, and since there is only one single.php all the posts look the same regardless of the category.
    Ideally I'd like to maintain the layout/style from the category in the single post template as well, but that doesn't seem to be (easily) possible.
    Does anyone know a nice way to do what I'm thinking of?

    So far the only solution I have is to use the ThemeSwitcher plugin (http://dev.wp-plugins.org/wiki/ThemeSwitcher) to display each category using a separate theme, therefore they will all have their own single.php files.
    The plugin doesn't offer this funtionality so it will need some modification to allow this, so before I go down that road of hacking plugins I thought I'd ask if there's an easier way.

    Suggestions?

  2. Lorelle
    Member
    Posted 8 years ago #

    The explanation is here at http://codex.wordpress.org/The_Loop_in_Action#Different_Category_Format and the whole article will help you figure this out. I used this technique for one of my main categories and it's brilliant!

Topic Closed

This topic has been closed to new replies.

About this Topic