Displaying categories in two-level dropline
-
Hello, I found a great tutorial about displaying pages and child pages in a very nice dropline, but I need the same functionality for categories instead.
The original code:
<ul id="nav"> <?php wp_list_pages('title_li=&depth=1'); ?> <?php if($post->post_parent) $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0"); else $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0"); if ($children) { ?> <ul id="subnav"> <?php echo $children; ?> <?php } else { ?> <?php } ?>
Is there any way to change things around to display categories? I understand I need to use wp_list_categories instead, but I’m guessing the $post variable will be different for categories?
Would appreciate any help. Thanks in advance!
Justine
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Displaying categories in two-level dropline’ is closed to new replies.