category template if statement for cat children
-
I made a category.php file, and I have the following code in it.
<?php if (is_category('1')) {include "cat_showcase.php";} if (is_category('36')) {include "cat_blog.php";} ?>
This works perfectly for cats 1 and 36. However I would like to also say something like if the category is a child of category 1 then include cat_showcase.php. Because I have several sub cats, and cat 1 is the parent. Right now if I click on a sub cat it doesn’t load anything. Is there a way to tell it to look at all children of a parent category so I don’t have to have an array listing every single sub category I have? Thanks!
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘category template if statement for cat children’ is closed to new replies.