Support » Themes and Templates » Category header for individual posts

  • 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.

Viewing 2 replies - 1 through 2 (of 2 total)
  • 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.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Category header for individual posts’ is closed to new replies.