Hide Second Category Display

Hello,

I am looking for a custom css code that will hide all the various category names from showing up aside from the primary category. For instance, my site is and we have articles falling under “menswear”, “fitness”, “health & nutrition”, “productivity” and “misc.” There are instances where a category will fall under both but I don’t want all the categories to show up on the main page or article itself. Currently we’ve defaulted to one category each to avoid this issue.

The second part to this question is, we want to be able to create another “dummy” category to say “featured” or something along those lines so that we can select the slider to display only these posts. I’m hoping the solution above will also work for this purpose.

Any help will be greatly appreciated.

Best,
Jonathan

Hi Jonathan,

I hope you are well today and thank you for your question.

Could you please share me your site URL where these categories are displaying and tell me which categories you want to hide and which you want to display so that i can help you to achieve it?

Kind Regards,
Movin

Hi Movin,

Our site is www.fortodaysman.com and we have a category called “featured” that we would like to use for certain articles. My understanding is that we can set the slider to display only these featured posts. But how do I get it so that only the primary category displays when reading the actual post (http://fortodaysman.com/2016/11/preventovereating/). Also is there a way to hide this “featured” category from the category list in the bottom right? .

Thank you for taking the time to help.

Jonathan

You can try achieving this by adding the following CSS code in the Custom CSS option of your theme on the below path.

Admin Area -> Appearance -> Customize -> Activello Options -> Other -> Custom CSS

.widget ul li.cat-item.cat-item-18,
.cat-title ul.post-categories li:first-child {
    display: none;
}

@movin Thank you! this worked. How did you find out it was cat item 18?

You are most welcome here :slight_smile:

How did you find out it was cat item 18?

Using browser inspector as described on the following pages.