/ Published in: PHP

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php $ID = $wp_query->posts[0]->ID; $postcat = get_the_category($ID); $cat = $postcat[0]->cat_ID; $parent = get_category ($cat); if ($parent->parent) { wp_list_categories ('child_of=' . $parent->parent); } else { wp_list_categories ('child_of=' . $cat); } ?>
Comments
