Make WordPress Core

Ticket #10676: category-template-10676.diff

File category-template-10676.diff, 752 bytes (added by ardathksheyna, 10 years ago)
  • category-template.php

     
    871871                        $class = 'cat-item cat-item-' . $category->term_id;
    872872                        if ( !empty($current_category) ) {
    873873                                $_current_category = get_term( $current_category, $category->taxonomy );
     874                                $category_ancestors = array_reverse(get_ancestors($current_category, $category->taxonomy));
     875                               
     876                                if (in_array($category->term_id, $category_ancestors) && $hierarchical)
     877                                        $class .= ' current-cat-ancestor';
     878                               
    874879                                if ( $category->term_id == $current_category )
    875880                                        $class .=  ' current-cat';
    876881                                elseif ( $category->term_id == $_current_category->parent )