GATEKeeper
Member
Posted 4 years ago #
Looking to insert a bit of code into my "single" template page to show custom titled headers for every category (i.e. "category-13"), so how would I make that work in an if statement?
The idea I had that doesn't work is:
<?php if ( in_category('category_id') ): ?>
include(TEMPLATEPATH . '/single-'category_id'.php');
<?php endif; ?>
Any help would be vastly appreciated.
I created new header files called header2.php, etc and used this code to call the header for each category template:
<?php include (TEMPLATEPATH . '/header2.php'); ?>
What I haven't figured out yet is how to have the category header display on category posts. Anyone?
To answer my own question, the custom post templates plugin does the trick.