/ Published in: PHP

Uses the 'current_category' parameter of 'wp_list_categories'. Add relevant CSS as appropriate...
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php // ...for 'wp_list_categories' if(is_single()) { $category = get_the_category(); $class .= $category[0]->cat_ID; }?> <?php wp_list_categories('orderby=id&child_of='.$categoryObj->category_parent.'&hide_empty=0&title_li=&use_desc_for_title=0&exclude=5¤t_category='.$class); ?>
URL: http://codex.wordpress.org/Template_Tags/wp_list_categories
Comments
