Skip Navigation

[Resolved] Custom fields based on post catgory

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

Problem: I see that it's possible to use data-dependent field display in the wp-admin area. Is it possible to have conditional fields display based on post category?

Solution: Data-dependent logic for displaying custom fields can be used in the wp-admin area but the conditional logic must be dependent upon other custom fields, not taxonomy terms associated with a post.

Relevant Documentation: https://toolset.com/documentation/user-guides/types-custom-fields-conditional-display/

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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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 vijayB-4 6 years, 9 months ago.

Assisted by: Christian Cox.

Author
Posts
#547875

Hi,
I am trying to build a personal blog site. The site will have multiple sections like book reviews, product reviews etc Is it possible for me to have specific custom fields for example in books I need fields like Author name and Publication date and product details may be Company name type of product

Can you suggest if I need to create custom post types for each kind of post or can I use the Generic WordPress posts and add Custom fields based on category? ( I have seen something called Data Dependent Filters So is it possible to attach a custom field to a post and depending on that choice the other fields are exposed)

Vijay

#547953

Hi, I'll try to help you set things up in the best way for your site.

I have seen something called Data Dependent Filters So is it possible to attach a custom field to a post and depending on that choice the other fields are exposed
Data Dependent Filters are based on custom fields, not taxonomies. In other words, it's not possible to have certain custom fields display on a post depending on the category of the post. The filters must be based on other custom fields created in Types.

Can you suggest if I need to create custom post types for each kind of post
Will you ever include multiple book reviews in a single post, or multiple types of reviews in a single post? Or is each post a single review?

If it's always a single review, I think it is probably best to create separate custom post types for each kind of review. Then you can apply the correct custom fields to each kind of review.

#548241

Hi Christian,

Thanks for your reply.

Just a thought, In case I add a custom field in WordPress posts called say Category or Genre, Then when I create a post is it possible for me to use data dependent filters to have custom fields to be displayed.

For example hile writing a book review I choose Books in the Genre or Category which is a cuatom field. When I choose books I get the option to Add fields which are details of books, Similar for say products

Vijay

#548391

Hi Vijay,
Yes this is certainly a possibility. You can use custom fields instead of native WordPress taxonomies. The main difference is that you will lose the functionality that comes with native WordPress taxonomies. For example, WordPress automatically creates archives for posts in a specific taxonomy term. Your custom fields will not be given these automatic archives. Instead you must create your own WordPress Archives and add them to your site manually.

#549560

Thank you very much

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