Archived topic
Disable elements for all posts in a category?
7 replies · Started by Are Martin on June 2, 2015
The disable elements box that appears on posts and pages is a very useful feature. However, I was wondering if it is possible to add this option to the edit-category page as well?
I need to disable an element for all posts in a specific category and it would be a timesaver if it was possible to disable the element for the entire category instead of ticking the box on each individual post.
It would be great if this was possible!
Regards
Are Martin Kallåk
Hi Are,
If the edit category page allowed metaboxes, I would definitely do this, but unfortunately it doesn't.
Instead, you can use some pretty simple CSS.
What element are you trying to disable?
Hi Tom,
Thanks for quick reply! :)
I´m trying to disable the secondary navigation for an entire category...
First, go to "Posts > Categories" - notice the "slugs" for each category?
Use this CSS with your desired category slug:
.category-slug .secondary-navigation {
display: none;
}
Wow, that simple!?
Thanks a lot! :)
and if I wanted to disable the secondary navigation for all archive pages I guess it would be:
.archives .secondary-navigation {
display: none;
}
correct?
Almost!
.archive .secondary-navigation {
display: none;
}
No "s" :)
Perfect! Thanks a lot! :)
You're welcome! :)
