Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- switch(count(explode('|', get_category_parents(get_query_var('cat'),false,'|') ) )-1) {
- case 1:
- echo "ancestor";
- /*the code for the 'parent' list with descriptions here;
- i.e. get_categories('parent=' . get_query_var('cat') ); etc*/
- break;
- case 2:
- echo "parent";
- /*the code for the 'category' list with descriptions here;
- i.e. get_categories('parent=' . get_query_var('cat') ); etc*/
- break;
- case 3:
- echo "category";
- /*the code for the loop with posts of the category here;
- i.e. query_posts(array('category__in' => array( get_query_var('cat') ) ) ); etc*/
- break;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement