Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // If is category or subcategory of $cat_id
- if (!function_exists('is_category_or_sub')) {
- function is_category_or_sub($cat_id = 0) {
- foreach (get_the_category() as $cat) {
- if ($cat_id == $cat->cat_ID || cat_is_ancestor_of($cat_id, $cat)) return true;
- }
- return false;
- }
- }
- ?>
- <?php if (is_category_or_sub(4)) : ?>
- <?php load_template(TEMPLATEPATH . '/cat_videopagine.php'); ?>
- <?php elseif (is_category_or_sub(5)) : ?>
- <?php load_template(TEMPLATEPATH . '/cat_speciali.php'); ?>
- <?php else : ?>
- DEFAULT
- <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement