Skip Navigation

[Resolved] CRED Field Checkboxes – Display only parent categories

This thread is resolved. Here is a description of the problem and solution.

Problem: I would only like to show top-level taxonomy checkboxes in my CRED form, but all hierarchical levels are showing

Solution: Hide sub-levels using CSS:

.no-level-4 ul ul {
  display: none !important;
}
This support ticket is created 6 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 4 replies, has 2 voices.

Last updated by davidG-5 6 years, 10 months ago.

Assisted by: Christian Cox.

Author
Posts
#527532
Screen Shot 2017-05-23 at 7.11.18 AM.png
Screen Shot 2017-05-23 at 7.11.09 AM.png

I am trying to: display only the parent items in the categories instead of all categories. I have used the cred field checkbox to display the categories to select. I only want to display the first level of categories and not their children. Is this possible?

#527704

Hi, CRED isn't set up to allow you to filter these options like that, but I could probably provide a CSS and / or JavaScript solution for you. I would need to see the form and look at your page structure to provide that code. Is the form online somewhere?

#528456
Screen-Shot-2017-05-25-at-4.21.19-PM.jpg

Hi, thanks for your reply. Unfortunately, the form is not live for the public because it is users that have logged in and the user fills out the form through his/her account. I have attached a a screenshot of the entire cred form, will this help?

#528571

Try adding this CSS in Appearance > Customize > Custom CSS:

.no-level-4 ul ul {
  display: none !important;
}

If this doesn't work, I'll need one more screenshot showing your page source code. This will help me determine what CSS structure needs to be used to target these child lists. Thanks!

#528691

Thanks, I didn't even think of using CSS to hide. It work perfectly.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.