I have a custom post type Book and a child custom post type (to book) called Person. A book has for example 2 persons associated viz. Beck and Mike. Beck is the Author and Mike is the Editor. Author and Editor are custom taxonomies (called Profession) associated with Person custom post type.
Now in the list of Books (admin screen) I want to have 2 sortable columns Author and Editor which should list all the author and editors associated with a Book. How can I achieve this? I am using Types plugin and Codepress Admin Columns plugin.
If this is not possible can I display all Persons associated with a book with the below code? Well even this snippet isn't working. Can somebody point me what I am doing wrong?
case "persons": query_posts( array( 'post_type' => 'books', 'meta_query' => array( array( 'key' => '_wpcf_belongs_books_id', 'value' => $post_id, 'compare' => '==', 'type' => 'numeric', ), ) ) ); if (have_posts()) : while (have_posts()) : the_post(); $post_id = get_the_ID() ; echo the_title(); endwhile; else : echo 'Nothing'; endif; break; }