is_category conditionals
-
I wanted to add a specific condition to my archive template that causes a different headline to display for a certain category. So I thought it would be easy enough to add an additional elseif condition to the archive template with all the others, but I keep getting a php error about an unexpected T_ELSE.
So this is the code I was using:
<?php /* If this is a category archive */ if (is_category(5)) { ?>
<h2 class="pagetitle">Archive for the '<?php echo single_cat_title(); ?>' Category</h2>
<?php /* If this is a category archive */ elseif (is_category()) { ?>
<h2 class="pagetitle"><?php echo single_cat_title(); ?></h2>I’ve tries using just else, and that doesn’t help either. Basically for Category 5 (and it’s children if possible) I want to have that different category title to display.
Thanks!
- The topic ‘is_category conditionals’ is closed to new replies.