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 badges1 Answer
Reset to default 0You 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
版权声明:本文标题:How to use terms from the same custom taxonomy in different roles in a custom post type? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742413906a2470337.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论