• We needed to “Only show children of the current category” but this setting in “Woocommerce Product Categories Widget” hides parents, so here’s a solution.

    add css to expand or show only current categories in sidebar menu:

    expand:

    .cat-parent li.cat-item {display:none; }
    li.current-cat-parent,  li.current-cat,  li.current-cat li.cat-item,  .current-cat-parent li.cat-item {display:list-item !important;}

    only show current category, where all categories have sub categories (like https://925e.com or https://ourjewelleryshop.com ):

    li.cat-parent, .cat-parent li.cat-item {display:none; }
    li.current-cat-parent,  li.current-cat,  li.current-cat li.cat-item,  .current-cat-parent li.cat-item {display:list-item !important;}
  • The topic ‘[solved] woocommerce expand or show only current categories in sidebar menu’ is closed to new replies.