Skip Navigation

Taxonomy list in page

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.

This topic contains 6 replies, has 2 voices.

Last updated by michalB-6 3 months, 2 weeks ago.

Assigned support staff: Luo Yang.

Author
Posts
#2381645

Tell us what you are trying to do?
I'm building a classifieds page and would like to display a list of all my Custom Post Type taxonomies (categories) on one of the pages (Add Advertisement page) (these will be a list of titles and images). Then, a user who wants to add an Advertisement will choose the category and be taken to the form for that category. Is it possible to do such a thing?

#2381791

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

Hello,

It is possible with Toolset plugins.

For example, you can try these:
1) Create a custom post type "Advertisement" with custom taxonomy "categories"
https://toolset.com/course-lesson/creating-a-custom-post-type/

2) Enable legacy editor:
https://toolset.com/course-lesson/enabling-legacy-version-of-toolset-views/
It is required to use legacy editor to setup below taxonomy view

3) Dashboard-> Toolset-> Views, create a taxonomy view:
- Query terms of taxonomy "categories"
- In view's loop, display term information, and link to target page of step 5), and pass term ID value as URL parameter

4) Create page "Choose category", display above taxonomy view

5) Create a page "Add Advertisement", in this page display a post form for creating new "Advertisement" posts:
https://toolset.com/course-lesson/front-end-forms-for-adding-content/
add a generic hidden field to store the term ID URL parameter value:
https://toolset.com/documentation/programmer-reference/forms/cred-shortcodes/#cred_generic_field
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-search-term

6) After user submit the post form, use action hook "cred_save_data", to trigger a custom PHP function, and set the taxonomy "categories"
https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data
https://developer.wordpress.org/reference/functions/wp_set_post_terms/

#2384155

Thank you very much for your help.
I'm almost done with everything from your suggestions and it's work but I have a problem with this shortcode

[cred_generic_field field="adds-categories" type="hidden" urlparam="termId"][/cred_generic_field] 

When I use it in page content fields and text section it is not rendered, displayed as text.
When I try to put it into the form as an "Insert Html Content" after the form is rendered the hidden field isn't generated, just an empty form row.

Regards

#2384391

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

You can put the generic hidden field into post form content, if you need more assistance for it, please provide a test site with the same problem, fill below private message box with login details, also point out the problem page URLs and form URL, I can setup a demo for you

#2384901

Ok, now it's work. I have another question can I display specific forms only for specific taxonomy? For example, I have the category Cars and I want to display the form only when the user chooses a car category, and if the user chooses the category boats to display the form for boats. I tried to use the "Appears on" section in Edit Post Field Group form and add conditions for Post Type and Taxonomy but is not working. The form is displayed even when I choose a category that doesn't match the condition.

New threads created by Luo Yang and linked to this one are listed below:

https://toolset.com/forums/topic/can-i-display-specific-forms-only-for-specific-taxonomy/

#2385111

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

I assume the original question of this thread is resolved, according to our support policy, we prefer one ticket one question.
For other new questions please check the new thread here:
https://toolset.com/forums/topic/can-i-display-specific-forms-only-for-specific-taxonomy/

#2385609

My issue is resolved now. Thank you!