I’m currently working on a theme that I need to make custom category pages and single pages. I have a plugin almost ready for re-release but instead I went the template route.
One of the first issues I found, the in_category function doesn’t support the category name,
<?php
if (in_category('CATEGORY-NAME')) {
load_template(TEMPLATEPATH . '/category-special.php');
}
else {
get_header();
load_template(TEMPLATEPATH . '/category-default.php');
} ?>
and since this client requires the category name (because of multiple development environments having different category ids) a simple get_cat_id retrieved the category ID for in_category. Example,
<?php
if ( in_category(get_cat_id('CAT NAME')) ) {
load_template(TEMPLATEPATH . '/category-CATNAME-template.php');
}
else {
get_header();
load_template(TEMPLATEPATH . '/category-default.php');
} ?>
So, the above code will replace the category.php file but make sure to copy the existing code to a new template, in the example above use category-default.php. The rest should be self explanatory.
