Return to Snippet

Revision: 51204
at September 16, 2011 23:14 by S_Park


Initial Code
<?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&current_category='.$class); ?>

Initial URL
http://codex.wordpress.org/Template_Tags/wp_list_categories

Initial Description
Uses the 'current_category' parameter of 'wp_list_categories'. Add relevant CSS as appropriate...

Initial Title
Highlight current Wordpress category on a single page 'wp_list_categories'

Initial Tags
wordpress

Initial Language
PHP