Make WordPress Core


Ignore:
Timestamp:
11/10/2005 11:42:56 PM (21 years ago)
Author:
ryan
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/template-functions-category.php

    r3011 r3033  
    273273
    274274function 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) {
    275         global $wpdb, $category_posts;
     275        global $wpdb, $category_posts, $wp_query;;
    276276        // Optiondates now works
    277277        if ( '' == $file )
     
    382382                        }
    383383
    384                         if ( $list )
    385                                 $thelist .= "\t<li>$link\n";
    386                         else
     384                        if ( $list ) {
     385                                $thelist .= "\t<li";
     386                                if (($category->cat_ID == $wp_query->get_queried_object_id()) && is_category()) {
     387                                        $thelist .=  ' class="current-cat"';
     388                                }
     389                                $thelist .= ">$link\n";
     390                        } else {
    387391                                $thelist .= "\t$link<br />\n";
     392                        }
    388393
    389394                        if ($hierarchical && $children)
Note: See TracChangeset for help on using the changeset viewer.