Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

My client wants to implement a special appearance to each of our category pages. Kind of like child themes... she wants to shift the background image, change a few graphics, and tweak the colors according to which category the user is visiting (horror, romance, etc).

Is there a reasonable way to do this besides creating a different template for each page with imported CSS styles? Or is that really the only path to accomplish this?

UPDATE: The answers below are all great. For our purposes, the easiest thing to do was to use the category specific classes provided by "body_class()" to override current styles.

Thanks!

share|improve this question
    
If you came up with solution other than covered in answers, please add it as answer and not as part of question. Better for organization and voting. :) –  Rarst Feb 4 '11 at 6:34

2 Answers 2

up vote 1 down vote accepted

If changes do not require modifications to HTML markup you can accomplish that by loading conditionally additional CSS style files. See Conditional Tags > A Category Page and wp_enqueue_style() in Codex.

share|improve this answer

The bulk of your theme is made up of three files, header.php, footer.php and style.css.

If you want to load an alternative header, footer and/or stylesheet simply update the appropriate calls inside the category template(category.php) to pull in a different header/footer/stylesheet.

Example.

get_header();

Becomes.

get_header( 'cat' );

Would then include header-cat.php instead of header.php.
You can do the same with the get_footer() call to include a different footer file.

Using alternate header/footer files is covered on the Codex pages.
http://codex.wordpress.org/Function_Reference/get_header
http://codex.wordpress.org/Function_Reference/get_footer

For the stylesheet, simply change this(in your new header file).

<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />

For something like..

<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_directory' ); ?>/style2.css" />

Or alternatively, use wp_enqueue_style as suggested in the other answer.

Completely custom HTML and CSS without effecting any other kinds of pages(and no changes needed to the existing header/footer/stylesheet).

share|improve this answer

Your Answer

 
discard

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.