- This topic has 4 replies, 2 voices, and was last updated 6 years ago by
Steve.
-
AuthorPosts
-
-
February 3, 2016 at 10:02 am #5834
ireneMemberI was wondering if it is possible to use a field-relate (shown as select) in an add-more.
I would like to have the layout of the advanced relate but instead of creating new posts,
I would like to pull in existing posts from another post type with a select type field.Thanks,
Irene -
February 3, 2016 at 11:51 am #5841
-
February 3, 2016 at 12:15 pm #5842
ireneMemberHello Steve,
Maybe I could use that…
Thinking and re-thinking…
Hope I can explain…
I have 2 cpt’s
1. Dogs
2. Litters
In the Dogs CPT all dogs are entered (bitches, dogs and pups with category male ore female
In the Litters cpt, create a new litter => Choose dam, from dogs-cpt, category female
Choose sire, from dogs-cpt, category male
These 2 form the parents.
Then below that the pups (children, need to be related to dam and sire, and are siblings. These pups are also coming from Dogs cpt- resp, female or male….I can not find anywhere if when I use an add more the items chosen are directly related to the post.
New to all this but willing to learn 🙂
Hope you can follow me and if you can advise me on how to achieve this…Thanks,
Irene -
February 8, 2016 at 8:05 am #5873
ireneMemberExcuse me for bothering you again…
Trying to get the following:
I would like to render the selected post on the post edit page and used the following/* Title: Nest Informatie Post Type: nesten Status: auto-draft Collapse: false Meta box: false */ piklist('field', array( 'type' => 'group' ,'template' => 'field' ,'fields' => array( array( 'type' => 'select' ,'field' => 'sire' ,'label' => 'Sire:' ,'columns' => 6 ,'choices' => piklist( get_posts( array( 'sort_order' => 'ASC' ,'post_type' => 'hond' ,'post_status' => 'publish' ,'tax_query' => array( array( 'taxonomy' => 'geslacht' ,'field' => 'slug' ,'terms' => 'reu' )) ) ,'objects' ) ,array( 'ID' ,'post_title') ) )and the following on the next page:
/* Title: edit nesten Post Type: nesten Status: publish Collapse: false Meta box: false */ ?> <?php $value_sire=get_post_meta(get_the_ID(), 'sire', true); $sire_post_id= $value_sire['ID']; $sire_permalink= get_permalink($sire_post_id); $sire_name= get_post_meta($sire_post_id, 'sire',true); ?> <ul> <li> <a href=" <?php echo $sire_permalink; ?>" <?php echo $sire_name; ?></a></li> </ul>Both nothing shows up on the second page… I am missing something…
Have been reading this post select-box-for-displaying-posts but can not figure it out…
-
February 8, 2016 at 2:06 pm #5878
-
-
AuthorPosts
- You must be logged in to reply to this topic.