Wordpress - How Do I Assign Posts from A Category A Different Template?

Status
Not open for further replies.

Rob_TID

New member
Jun 24, 2006
1,368
16
0
Ok, so let's say I have three categories - Red, Green and Blue

I am happy for the whole site to have the same template.

BUT I want the posts in the Blue category alone, to have their own template.

Is there a plugin to do this?


Basically the logic is: IF post category = Blue THEN post template = single-2.php
 


You can pull this off easy enough without the use of a plugin. Check out the template documentation at wordpress.org .
 
red = category 1
blue = category 2
green = category 3

single view = single-1.php , single-2.php single-3.php
cat view = category-1.php category-2.php category-3.php

There's also the plugin way
Also you can use elseif or other php statements
If you use statements you have more control and it will help your learning also you will have less files in your theme folder or less theme folders all together depending on what you do
 
Status
Not open for further replies.