Conditional tag asking for parent category
-
I’m using Conditional Tags on my single.php to use Category Templates for my single post view.
Right now, I’m doing it with this code:
<?php $post = $wp_query->post; if (in_category(15)) { include(TEMPLATEPATH . '/category-3_sub.php'); } else { include(TEMPLATEPATH . '/index.php'); } ?>
There’s just one problem. The Conditional Tag is just asking for the child category, and I would like to ask for the parent category.
I’m a total php newbie, so would be nice if somebody could help me out. Thanks a lot.
Karina
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Conditional tag asking for parent category’ is closed to new replies.