php q: Is this page a descendant of this category
-
Hi. I’m trying to setup an if condition to display two different index templates.
If the page is not category ‘art’ or it’s descendants, display the normal loop page.
If it is, display the ‘art’ loop page.
Trouble is I’m not skilled enough to hack together php for discovering if a category is child of a category.
Here’s what I’ve got, which works, except for detecting if the category is a child of ‘art’
<?php $id = get_cat_id('art'); ?> <?php if ( is_category('$id') || is_category ( $parent = $id )) echo include(TEMPLATEPATH . '/loop-art.php'); else echo include(TEMPLATEPATH . '/loop-normal.php'); ?>
I’ve done quite a bit of looking around – I always do before I ask for help… so suggestions will be very appreciated.
Ali
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘php q: Is this page a descendant of this category’ is closed to new replies.