Hiding a category from home page – ubud theme

  • Unknown's avatar

    Hi, I’ve been trying to hide some categories from showing up on my home/latest posts using this CSS that I found:

    .home article {
    display: none;
    }
    .home article.category-corporate {
    display: block;
    }

    (supposing I only want to show the corporate category)

    But so far nothing happens when I add the code. Am I doing something wrong or does it have something to do with my theme?

    Thank you!

    The blog I need help with is: (visible only to logged in users)

  • Hi.

    That should work… Where do you add this code? At CSS customizer?

  • Unknown's avatar

    Yes, in fact I’ve added quite a bit of CSS code to my website so I tried just deleting that just to double check if maybe there were conflicting entries but it doesn’t do anything when I paste the code I posted above.

  • Unknown's avatar

    @darmahweb, to hide the posts in the Corporate category from the home (posts) page, add the following CSS.

    .home .site-content .post.category-corporate {
        display: none;
    }

    You can use that as a guide in the event you want to hide additional categories of posts from the main page.

  • The topic ‘Hiding a category from home page – ubud theme’ is closed to new replies.