Jump to content
Sign in to follow this  

Conditional CSS with hooks

Recommended Posts


I am developing a blog that uses Categories as "pages". The Categories have replaced Pages in the menu. So they behave like pages, I've added a hook that adds a page-title styled "Stories in [Category]" to Category pages. The only problem is removing the "Currently viewing the category: [Category]". I realize I can just add the code:

	display: none;

But, if I do, it kills the Tags and Search results titles ("Currently viewing the tag: [Tag]", etc...). My thought was add the CSS to my hook to not display the .current-posts-info on Category pages. Only problem is I don't know how to do this. Any help?

Share this post

Link to post
Share on other sites

.current_posts_info is going to change all posts info no matter what. You need to be more specific with the CSS selector. For example,

body.category-CATEGORYNAME .current_posts_info {display:none;}

can only hide the posts info for only the category specified in body.category-CATEGORYNAME (and the same applicable for other category pages, tags, etc.).

Please read the docs before posting. Please do not private message me unless I ask you to.

Designer | Catrina Dulay

Founder | Catrina and Mouse

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this