Title: Adding Custom Fields linked to Custom Post Type
Last modified: August 22, 2016

---

# Adding Custom Fields linked to Custom Post Type

 *  [lorembolo](https://wordpress.org/support/users/lorembolo/)
 * (@lorembolo)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/adding-custom-fields-linked-to-custom-post-type/)
 * Hi,
    I’m massively using Types on a website I’m working on since it’s really 
   easy and powerfull. I have 2 Custom Posst, let’s call them “Book” and “Authors”.
 * In the edit panel for a Book, I would like to add a custom field “Author” wich
   would be a dropdownlist with the author associated to the book.
 * I’m wondering how to achieve this, ie the dropdown list should retrieve all Authors,
   show them and store (for ex) the ID of the selected author.
 * Of course, this is an example, the project is a bit more complex (so that I can’t
   use taxonomy “author”, or use the parent relations built in types).
 * Is ther a way to acheive this (without the use of Views, indeed)
 * Thanks in advance.
 * [https://wordpress.org/plugins/types/](https://wordpress.org/plugins/types/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [Marcin Pietrzak](https://wordpress.org/support/users/iworks/)
 * (@iworks)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/adding-custom-fields-linked-to-custom-post-type/#post-5448951)
 * Dear lorembolo
 * You can setup CPT “Author” as a parent to “Book”. See this example: [http://wp-types.com/documentation/user-guides/creating-post-type-relationships/](http://wp-types.com/documentation/user-guides/creating-post-type-relationships/)
 * This data is stored as post meta for book in custom field key: `_wpcf_belongs_authir_id`.
   If Author CPT has `author` slug.
 * Marcin
 *  Thread Starter [lorembolo](https://wordpress.org/support/users/lorembolo/)
 * (@lorembolo)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/adding-custom-fields-linked-to-custom-post-type/#post-5448953)
 * Thanks for your answer Marcin.
 * As I mentionned, I can’t use the parent relationship for this use. (it(s more
   complicated than the description above)
 * Ther is no other way to achieve this ? I heard of post2post or ACF relationship,
   they seem to do what I want…
 * And, by the way, I already use the relationship beetween 2 CP, but, the meta 
   box showing is not really user friendly.
    It shows the slug of the taxonomy, 
   instead of its name, and the message is not really clear
 * Screenshot : [http://wordpress.winesandchateaux.com/wp-content/uploads/2014/11/screenshot-wordpress-winesandchateaux-com-2014-11-04-15-19-44.png](http://wordpress.winesandchateaux.com/wp-content/uploads/2014/11/screenshot-wordpress-winesandchateaux-com-2014-11-04-15-19-44.png)
 *  [Marcin Pietrzak](https://wordpress.org/support/users/iworks/)
 * (@iworks)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/adding-custom-fields-linked-to-custom-post-type/#post-5449055)
 * Dear lorembolo
 * You can fill select using `wpt_field_options` filter. See this example: [https://wordpress.org/support/topic/user-select-field?replies=2#post-6191259](https://wordpress.org/support/topic/user-select-field?replies=2#post-6191259)
 * Maybe it could help?
 * Marcin

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Adding Custom Fields linked to Custom Post Type’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/types_ced1d3.svg)
 * [Toolset Types - Custom Post Types, Custom Fields and Taxonomies](https://wordpress.org/plugins/types/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/types/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/types/)
 * [Active Topics](https://wordpress.org/support/plugin/types/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/types/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/types/reviews/)

## Tags

 * [custom fields](https://wordpress.org/support/topic-tag/custom-fields/)
 * [custom post](https://wordpress.org/support/topic-tag/custom-post/)
 * [meta boxes](https://wordpress.org/support/topic-tag/meta-boxes/)

 * 3 replies
 * 2 participants
 * Last reply from: [Marcin Pietrzak](https://wordpress.org/support/users/iworks/)
 * Last activity: [11 years, 6 months ago](https://wordpress.org/support/topic/adding-custom-fields-linked-to-custom-post-type/#post-5449055)
 * Status: not resolved