Merge pull request #580 from pixeltrix/apply-current-cat-parent-to-top-level-category

Apply the current-cat-parent class to the top level category
This commit is contained in:
Mike Jolley 2012-02-06 08:58:27 -08:00
commit f049c970dc
1 changed files with 3 additions and 0 deletions

View File

@ -104,6 +104,9 @@ class WooCommerce_Widget_Product_Categories extends WP_Widget {
echo '<li class="cat-item cat-item-'.$cat->term_id;
if (is_tax('product_cat', $cat->slug)) echo ' current-cat';
if ($current_cat && $current_cat_parent
&& $current_cat_parent->term_id == $cat->term_id
&& $current_cat_parent->term_id != $current_cat->term_id) echo ' current-cat-parent';
echo '"><a href="'.get_term_link( $cat->slug, 'product_cat' ).'">'.$cat->name.'</a>';