How to Hide Categories on Homepage:


(James) #1

For communities that focus on tags more importantly than categories, this is how you can hide the category table on the homepage/latest. This is also helpful if you have a sidebar and there’s not much space on topic lists.

Go to your theme settings and paste this in common CSS

td.category {
    display: none;
}
th.category.sortable {
    display: none;
}
th.category {
    display: none;
}

For mobile, paste this into the mobile CSS section:

.topic-list .topic-item-stats .category {
    display: none;
}

Hope this may be useful to some! :slight_smile:
I appreciate @awesomerobot for motivating me to further learn CSS to discover little hacks like this.

Thanks for the hand @Stranik


(Jeff Atwood) #2

This would be an exceedingly rare scenario.


(James) #3

Correct, but there are always edge cases. I don’t want to leave out those who are too shy or afraid to ask for these questions because the majority don’t require them.


(James) #4

Any idea why this doesn’t work for mobile?


(Evgeny) #5

Other templates are used for the mobile phone. Try to put, for example, User-Agent Switcher - Opera. Or change the value of general.useragent.override to do research and see what css is used in a particular case.


(James) #6

That’s a very useful tool, which led to the finding of this piece of code which will hide categories on mobile, too!

.topic-list .topic-item-stats .category {
    display: none;
}

Just add this to the mobile CSS of a theme only.


#7

This should be added to OP!
Why isn’t this post a wiki?


(James) #8

There isn’t anything more to add to the topic. The code is there for desktop and mobile.