Highlight current class. Props amanzi and skippy. fixes #1800

git-svn-id: http://svn.automattic.com/wordpress/trunk@3033 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2005-11-10 23:42:56 +00:00
parent d6800890df
commit c42cbf7d09
1 changed files with 9 additions and 4 deletions

View File

@ -272,7 +272,7 @@ function wp_list_cats($args = '') {
}
function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_order = 'asc', $file = '', $list = true, $optiondates = 0, $optioncount = 0, $hide_empty = 1, $use_desc_for_title = 1, $children=FALSE, $child_of=0, $categories=0, $recurse=0, $feed = '', $feed_image = '', $exclude = '', $hierarchical=FALSE) {
global $wpdb, $category_posts;
global $wpdb, $category_posts, $wp_query;;
// Optiondates now works
if ( '' == $file )
$file = get_settings('home') . '/';
@ -381,10 +381,15 @@ function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_orde
$link .= ' ' . gmdate($optiondates, $category_timestamp["$category->cat_ID"]);
}
if ( $list )
$thelist .= "\t<li>$link\n";
else
if ( $list ) {
$thelist .= "\t<li";
if (($category->cat_ID == $wp_query->get_queried_object_id()) && is_category()) {
$thelist .= ' class="current-cat"';
}
$thelist .= ">$link\n";
} else {
$thelist .= "\t$link<br />\n";
}
if ($hierarchical && $children)
$thelist .= list_cats($optionall, $all, $sort_column, $sort_order, $file, $list, $optiondates, $optioncount, $hide_empty, $use_desc_for_title, $hierarchical, $category->cat_ID, $categories, 1, $feed, $feed_image, $exclude, $hierarchical);