admin管理员组

文章数量:1336632

How can I use terms from the same custom taxonomy in different roles in a custom post type?

I am developing a genealogy site which includes among other things biographies of ancestors, presentations about ancestors / family history and old letters that the ancestors have sent to each other. To link all this up I have a custom taxonomy 'Ancestor' that I use to tag which ancestors are mentioned in which post/page.

To make the letters part more accessible, I have created a custom post type 'Letter'. Now I would like to assign one 'Ancestor' as a 'sender' and one as a 'recipient' to each 'letter'.

How can I use terms from the same custom taxonomy in different roles in a custom post type?

I am developing a genealogy site which includes among other things biographies of ancestors, presentations about ancestors / family history and old letters that the ancestors have sent to each other. To link all this up I have a custom taxonomy 'Ancestor' that I use to tag which ancestors are mentioned in which post/page.

To make the letters part more accessible, I have created a custom post type 'Letter'. Now I would like to assign one 'Ancestor' as a 'sender' and one as a 'recipient' to each 'letter'.

Share Improve this question edited May 21, 2020 at 8:20 Touko asked May 20, 2020 at 20:49 ToukoTouko 133 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

You could create two custom meta fields for your custom post type 'letter'. With the plugin Advanced Custom Fields, this can be done in a minute: https://www.advancedcustomfields/resources/taxonomy/

With one field you choose your sender, with the other you chooce your receiver.

You can also create your fields by hand, but even the wordpress docs tell you that this plugins can be used: https://wordpress/support/article/custom-fields/

Meta Box Plugin: https://wordpress/plugins/meta-box/

Picklist: https://wordpress/plugins/piklist/

Advanced Custom Fields: https://wordpress/plugins/advanced-custom-fields/

Advanced Custom Fields is awesome! It really gives you the tools to turn your wordpress page in an easy to use but complex content management system.

There are a lot of build in fuctions to use and methods to save data, get data, show data and hook into before save and much more.

本文标签: How to use terms from the same custom taxonomy in different roles in a custom post type