Skip Navigation

[Resolved] How to create a single select Taxonomy Picker in CRED

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

Problem

How can I create a DropDown or Select field, that allows the User to choose only one term, in a CRED Form?

Solution

We have specific ShortCodes in place for Taxonomies, you will see them when you autogenerate the CRED Form.

How you can make a Single Select Field for Taxonomies is shown in the DOC linked below.

It requires a little manual editing of the ShortCode.

This is the attribute you use:

display

Optional. Used by fields for Hierarchical Taxonomies (like Categories) to signify the mode of display (ie. “select” or “checkbox”).

single_select

Optional. Boolean. If the display=select argument is set, then single_select=true will only allow a single option to be selected (by default multiple options can be selected). Defaults to false.

This support ticket is created 6 years, 9 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
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 1 reply, has 2 voices.

Last updated by Beda 6 years, 9 months ago.

Assisted by: Beda.

Author
Posts
#621466
Screen Shot 2018-03-02 at 10.23.52 AM.png
Screen Shot 2018-03-02 at 10.24.05 AM.png

I am trying to: add a custom taxonomy select field to a user created post with post field.

Link to a page where the issue can be seen: hidden link

I expected to see: a drop down with the custom taxonomies for classes.

Instead, I got: nothing.

#621652

You cannot use a taxonomy in a post field in a CRED Form.

We have specific ShortCodes in place for Taxonomies, you will see them when you autogenerate the CRED Form.

How you can make a Single Select Field for Taxonomies is shown here:
https://toolset.com/documentation/user-guides/cred-shortcodes/#cred_field

display. Optional. Used by fields for Hierarchical Taxonomies (like Categories) to signify the mode of display (ie. “select” or “checkbox”).
single_select. Optional. Boolean. If the display=select argument is set, then single_select=true will only allow a single option to be selected (by default multiple options can be selected). Defaults to false.

So you would create the Form with the AutoGenerate Button, then, you would find the taxonomy ShortCodes and change from native "display='checkbox'" to "display='select' select_single='true'".