Suppress subcategories in the hamburger menu

Is there any way to suppress the listing of subcategories (only list the parent category) in the hamburger menu. I’ve poked around quite a bit and not able to find a way.

Thanks!

1 Like

You can use this CSS :smiley:

.hamburger-panel .category-link.subcategory {
    display: none;
}
4 Likes

There’s also this theme component I’ve created in the past:

5 Likes

Thanks! I’ve added it. Works great.

2 Likes

One followup question (since I know nothing about CSS), without using the Category Hider, is there some CSS that I could add that would hide one specific category?

.hamburger-panel .category-link.category-{{slug}} {
    display: none
}

for example

.hamburger-panel .category-link.category-101-category {
    display: none
}
.hamburger-panel .category-link.category-general {
    display: none
}

To get the slug, you may need to press F12 to open DevTools.
image

@Lhc_fl Thank you again!

@keegan I did end up installing the Category Hider Theme Component for easier future flexibility. It’s working great, so thank you for that!

I did notice one typo in its settings:

Not a big deal, but thought you’d want to know that.

1 Like

@Loki Thanks for letting me know, I’ve pushed out a fix :slight_smile:

2 Likes