WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm working on a project where each category should have a custom header page. Any suggestions? I'm just looking for some direction on how to accomplish this.

share|improve this question
Any progress? Was one of the answers helpful? Do you still miss something? – toscho Oct 6 '12 at 22:30

Use the is_category() condtional statement

share|improve this answer

Install the plugin Taxonomy Images. In your header.php check if you are in a category archive and if an image exists for that category. Then use that instead of the default image.

share|improve this answer
I hv 5 category and 5 header.php..each category should hv a different header...i.e. category A with header_a.php Category B with header_b.php any suggestion... – Gopal Bhattacharjee Jun 13 '12 at 13:15

You can use custom templates for different categories. When displaying a category archive, WordPress will check for these files in order:

  1. category-{slug}.php
  2. category-{id}.php
  3. category.php
  4. archive.php
  5. index.php

Read more at the WordPress Codex

If you prefer to use the one category.php template, we can load custom header.php files based on the category's ID. Replace the call to get_header() in category.php with the following code:

global $wp_query;
get_header( 'category-' . get_query_var('cat') );

WordPress will then look for header-category-{category_id}.php and load that file if found. Otherwise, header.php will be loaded as normal.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.