Title: Separate templates for single posts
Last modified: August 18, 2016

---

# Separate templates for single posts

 *  Resolved [jdsnia](https://wordpress.org/support/users/jdsnia/)
 * (@jdsnia)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/separate-templates-for-single-posts/)
 * I’d like for single posts in different categories to use different templates.
   For example, if someone is looking at a post in the category “movies,” I’d like
   for it to have a different template than if they were looking at a post in the
   category “books.”
 * I can make the relevant posts pages and manually select a different theme for
   each one, but that seems… like a terrible solution. Any way to do this?

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [Michael Bishop](https://wordpress.org/support/users/miklb/)
 * (@miklb)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/separate-templates-for-single-posts/#post-390466)
 * Sure. You simply specify each category template. So if movies is cat id 5, then
   create a template category-5.php, books is cat id 7, so it’s template would be
   category-7.php, etc.
    [http://codex.wordpress.org/Template_Hierarchy](http://codex.wordpress.org/Template_Hierarchy)
   [http://codex.wordpress.org/Category_Templates](http://codex.wordpress.org/Category_Templates)
 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/separate-templates-for-single-posts/#post-390470)
 * Well, for **single posts** the category templates won’t work, but you can try
   this plugin:
    [http://guff.szub.net/2005/07/21/post-templates-by-category/](http://guff.szub.net/2005/07/21/post-templates-by-category/)(
   and there is also a similar one mentioned on that site – the inheritor)
 *  [Christopher J. Hradil](https://wordpress.org/support/users/chradil/)
 * (@chradil)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/separate-templates-for-single-posts/#post-390474)
 * you could go and hack up the appropriate php and template files, then create 
   css classes/id’s for each category, it would require a little work upfront, but
   would probably be the cleanest and most efficiant solution in terms of server
   overhead. I have one site which i’m converting to wordpress from “semi-static”
   content, and it’s separated by topic, i’m more or less just creating categories,
   then classes/id’s in the css and php to maintain the current look and feel of
   the site which is a bit different in each topic area.
 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/separate-templates-for-single-posts/#post-390496)
 * chradil,
    the average user doesn’t hack files – they simply don’t know how to
   do it, so “advices” like that are completely useless. Sorry. The solution I’ve
   posted does exactly what the OP was asking for and without any hackery. One just
   has to create the templates and call them through the plugin. (How to style those
   templates, i.e. classes/ids and their css definiton – is up to the user.)
 *  [Michael Bishop](https://wordpress.org/support/users/miklb/)
 * (@miklb)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/separate-templates-for-single-posts/#post-390527)
 * moshu, good catch, I didn’t see the “single post”.
 * Sorry jdsnia
 *  [Christopher J. Hradil](https://wordpress.org/support/users/chradil/)
 * (@chradil)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/separate-templates-for-single-posts/#post-390702)
 * moshu, I understand the abilities of the “average” user are sometimes limited.
   and “hack up the appropriate files” was a bit of an overstatement. I’m familiar
   with the plugin you’ve suggested, and it just seemed to me that since with the
   plugin the user would still need to create all of the css needed for each category
   anyway, adding a couple of lines and changing a few css classes in “single.php”
   would be alot easier than the process of creating the templates. plus would be
   easier on the server, etc should the site become popular.
 *  Thread Starter [jdsnia](https://wordpress.org/support/users/jdsnia/)
 * (@jdsnia)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/separate-templates-for-single-posts/#post-390999)
 * Thanks guys. Both suggestions were helpful, and good things to know.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Separate templates for single posts’ is closed to new replies.

 * 7 replies
 * 4 participants
 * Last reply from: [jdsnia](https://wordpress.org/support/users/jdsnia/)
 * Last activity: [20 years, 3 months ago](https://wordpress.org/support/topic/separate-templates-for-single-posts/#post-390999)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
