First on my cred child form, when i click on add post field, i don't see the button parent.
Second when i put this shortcode : [cred_post_parent get='id'] on my cred child form and go on a parent post, add my child form, fill it, the post is not automatically associate to the parent post.
My custom posts type are onetomany i have associate them.
Let me outline what's involved/required in case you have something missing:
- you have two post types and these are set on the post type edit screens in a parent-child relationship
- you create a CRED form to publish child posts. If you autogenerate the form then the required field to select the parent will be included automatically. For a parent post type of "project" this looks like:
[cred_field field='_wpcf_belongs_project_id' value='' select_text='--- not set ---' class='form-control' output='bootstrap']
- you create a template to display parent posts (either a Views Content Template, or a Template Layout) and with the CRED Forms button you add a link to the form to publish child posts, which would look something like this:
[cred_child_link_form form="28" parent_id="-1" text="Create new task" target="_blank"]
- Now when you visit a parent post on the front end you should see the link to create the child post. Clicking the link will bring up the form, and the parent selector will already be populated with the parent post you visited the link from. (If you don't want visitors to be able to change this you would need to hide it with CSS.)
- Submitting the form will automatically associate the parent to the new child.
Sorry, you are using the beta versions, but the main steps are similar.
- you create a CRED form to publish child posts and insert this form on a page. If you autogenerate the form then the required field to select the parent will be included automatically. In my example I'm using projects and tasks in a one-to-many relationship.
[cred_field field='@one-project-to-many-task.parent' select_text='--- not set ---' class='form-control' output='bootstrap']
Note the field includes the relationship name (slug format) and the .parent context.
- you create a template to display parent posts (either a Views Content Template, or a Template Layout) and with the CRED Forms button you add a link to the form to publish child posts (as shown in the screenshot), which would look something like this:
[cred_child_link_form form="124" parent_id="-1" text="Create new task" target="_self"]
- Now when you visit a parent post on the front end you should see the link to create the child post. Clicking the link will bring up the form, and the parent selector will already be populated with the parent post you visited the link from. (If you don't want visitors to be able to change this you would need to hide it with CSS.)
- Submitting the form will automatically associate the parent to the new child.