I've been trying to figure out how to make this work for sometimes now. I hope fellow DPer can help me out. here is the code: It's about customizing the header for each blog categories in wordpress. Please help. TQ in advance.
Check your category IDs in your database. if (is_category('1') is for the category with ID 1, etc or else replace ('1') with the category name as in if (is_category('My Category')
The problem is your markup. You don't need to throw in the extra <?php?> tags. This should work: <?php /**** Conditional Header for Per Category Example Wordpress ****/ // make sure we are in category listing if (is_category()) { if (is_category('1')) { include(TEMPLATEPATH.'/header-cat1.php'); } elseif (is_category('2')) { include(TEMPLATEPATH.'/header-cat2.php'); } else { // this is the deafult header include(TEMPLATEPATH.'/headerdefault.php'); } } ?> Code (markup):