OK, I was trying to do the same thing, took me ages to work this out but got it now …
Say, I have a post which has 2 assigned categories ‘journal’ and ‘family’
I want a special page header if user goes to archive pages for ‘family’
in archive.php go to this line:
<?php /* If this is a category archive */ if (is_category()) { ?>
now I added:
<?php
$theCat = ”;
foreach((get_the_category()) as $cat) {
$aCat = $cat->cat_name;
if ($aCat == ‘family’) $theCat = $cat->cat_name;
}
if ($theCat == ‘sylvia’) {
echo “my special code here”;
}
?>