Skip Navigation

[Resolved] Relation depending on a taxonomy.

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 3 replies, has 2 voices.

Last updated by Luo Yang 8 months, 1 week ago.

Assigned support staff: Luo Yang.

Author
Posts
#1901809

Hi support.

Is it possible to create a relation between post and a custom post type, but only if the post is in a specific taxonomy?

Like if you have a post in a category named book review, then you are able to relate that post to writer, but if the post is in a category Colors, then you can relate the post to a post type named paintings.?

The reason I ask is because otherwise the only alternative is to create custom post types for each relationships. And then you can't use the "default" post query for the blog roll, but have to build specialized queries.

I don't think it is possible, because the relationship wizard does not make it possible, but before I start that work of building lots of custom post types, I thought I would ask.

#1901989

Luo Yang
Supporter

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

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

Hello,

It is possible, for example, you can try these:
1) Create custom field group, in section "Appears on", click button "Edit", specific post type and taxonomy terms.
2) Then add a Post Reference Field in above group:
https://toolset.com/course-lesson/using-post-reference-field-to-set-up-one-to-many-relationships/

#1903243

Hello Luo

I am sorry but it is not possible to select a Postreference field type, when I create the new field.

Please see this video : hidden link

Cheers

#1903345

Luo Yang
Supporter

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

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

As I mentioned above, you need to specify the post type and taxonomy terms in section "Appears on".

And I have tried it in my localhost, it works fine, if you need more assistance for it, please provide a test site with the same problem, I can setup a demo for you