How can I remove the Child Categories from the Categories with Featured Topics view?

image

I’d like to remove the sub-category from this view. Does anyone have any idea how to do that?

Jacob

You can add this CSS to your theme:

.subcategories {
    display: none;
}

From:

To:

I’m not sure .subcategories is the best selector though. I don’t know if it’s used elsewhere on the forum. Then it may cause unintended effects.

2 Likes

So you can use this instead :D.

.categories-list .category-list.with-topics .subcategories {
    display: none;
}
1 Like

thanks @Canapin and @Lhc_fl

Yeah, that would be safer.


edit: I took a look at Discourse’s code, .subcategories alone should be safe (I personally like to use not too much selector depth if I can avoid it), and you should also consider hiding .subcategories-list as well as it’s the subcategories parent container on the mobile view.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.