wp-includes/category-template.php | 23 +++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)
diff --git a/wp-includes/category-template.php b/wp-includes/category-template.php
index 7369fda..05a39e9 100644
a
|
b
|
class Walker_Category extends Walker { |
1029 | 1027 | if ( $category->term_id == $args['current_category'] ) { |
1030 | 1028 | $class .= ' current-cat'; |
1031 | 1029 | } elseif ( $category->term_id == $_current_category->parent ) { |
1032 | | $class .= ' current-cat-parent'; |
| 1030 | $class .= ' current-cat-parent current-cat-ancestor'; |
| 1031 | } else { |
| 1032 | $_current_category_ancestor = get_term( $_current_category->parent, $category->taxonomy ); |
| 1033 | while( $_current_category_ancestor->parent ) { |
| 1034 | if ( $category->term_id == $_current_category_ancestor->parent ) { |
| 1035 | $class .= ' current-cat-ancestor'; |
| 1036 | break; |
| 1037 | } |
| 1038 | $_current_category_ancestor = get_term( $_current_category_ancestor->parent, $category->taxonomy ); |
| 1039 | } |
1033 | 1040 | } |
1034 | 1041 | } |
1035 | 1042 | $output .= ' class="' . $class . '"'; |